From 11eb57ceb22636fafbb1f1c1a49dda3956e6f7e4 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 2 Apr 2021 12:36:21 +0530 Subject: fmt --- src/lisp/expr.rs | 8 ++++---- src/lisp/prelude.rs | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lisp/expr.rs b/src/lisp/expr.rs index aeaa2d8..2319601 100644 --- a/src/lisp/expr.rs +++ b/src/lisp/expr.rs @@ -254,12 +254,12 @@ impl fmt::Debug for LispExpr { LispExpr::Number(n) => write!(f, "Number({:?})", n), LispExpr::List(l) => { write!(f, "List ")?; - f.debug_list().entries(l.iter()).finish() - }, + f.debug_list().entries(l.iter()).finish() + } LispExpr::DottedList(l) => { write!(f, "DottedList ")?; - f.debug_list().entries(l.iter()).finish() - }, + f.debug_list().entries(l.iter()).finish() + } LispExpr::StringLit(s) => write!(f, "String({:?})", s), LispExpr::Char(c) => write!(f, "Char({:?})", c), LispExpr::BoolLit(b) => write!(f, "Bool({:?})", b), diff --git a/src/lisp/prelude.rs b/src/lisp/prelude.rs index add405c..336dbaf 100644 --- a/src/lisp/prelude.rs +++ b/src/lisp/prelude.rs @@ -153,7 +153,9 @@ pub fn new_env() -> Result { (LispExpr::Unit, LispExpr::Unit) => Ok(true), (LispExpr::Number(s), LispExpr::Number(o)) => Ok(s == o), (LispExpr::List(s), LispExpr::List(o)) => Ok(s.iter().zip(o).all(|(a, b)| a == b)), - (LispExpr::DottedList(s), LispExpr::DottedList(o)) => Ok(s.iter().zip(o).all(|(a, b)| a == b)), + (LispExpr::DottedList(s), LispExpr::DottedList(o)) => { + Ok(s.iter().zip(o).all(|(a, b)| a == b)) + } (LispExpr::List(s), LispExpr::Unit) => Ok(s.len() == 0), (LispExpr::Unit, LispExpr::List(s)) => Ok(s.len() == 0), (LispExpr::DottedList(_), LispExpr::Unit) => Ok(false), @@ -319,7 +321,7 @@ pub fn new_env() -> Result { ls.remove(0); return Ok(LispExpr::List(ls)); } - } else if type_match!(args, 0 => LispExpr::DottedList(_)){ + } else if type_match!(args, 0 => LispExpr::DottedList(_)) { // cdr of an improper list is an improper list or an atom let ls = args[0].unwrap_dotted_list(); if ls.len() == 2 { -- cgit v1.2.3