aboutsummaryrefslogtreecommitdiff
path: root/rust/src/step2_eval.rs
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-10-25 13:00:01 -0500
committerJoel Martin <github@martintribe.org>2015-01-06 21:58:57 -0600
commit8f5b0f1040de849da3fb5ade645308e7bbe7f025 (patch)
treea65a2e2c1db5013338a83af101becf676517ba1d /rust/src/step2_eval.rs
parent0ab374bc261f871ab8fbbc13e0096f44225e2a3f (diff)
downloadmal-8f5b0f1040de849da3fb5ade645308e7bbe7f025.tar.gz
mal-8f5b0f1040de849da3fb5ade645308e7bbe7f025.zip
Rust: add step3_env
Diffstat (limited to 'rust/src/step2_eval.rs')
-rw-r--r--rust/src/step2_eval.rs3
1 files changed, 2 insertions, 1 deletions
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<String,MalVal>) -> 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)),
}