From 8f5b0f1040de849da3fb5ade645308e7bbe7f025 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 25 Oct 2014 13:00:01 -0500 Subject: Rust: add step3_env --- rust/src/step2_eval.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rust/src/step2_eval.rs') diff --git a/rust/src/step2_eval.rs b/rust/src/step2_eval.rs index 5df9a94..8d28a0f 100644 --- a/rust/src/step2_eval.rs +++ b/rust/src/step2_eval.rs @@ -6,6 +6,7 @@ extern crate regex; use std::rc::Rc; use std::collections::HashMap; + use types::{MalVal,MalRet,Nil,Int,Sym,List,Func}; mod readline; mod types; @@ -21,7 +22,7 @@ fn read(str: String) -> MalRet { fn eval_ast(ast: MalVal, env: &HashMap) -> MalRet { match *ast { Sym(ref sym) => { - match (*env).find_copy(sym) { + match env.find_copy(sym) { Some(mv) => Ok(mv), None => Ok(Rc::new(Nil)), } -- cgit v1.2.3