From 290393a62f896bffd5e103a1814093949f6780ac Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Mon, 14 Oct 2024 23:59:33 -0400 Subject: [PATCH] use a box for hashmap --- src/executor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/executor.rs b/src/executor.rs index fbe8c17..75930cd 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -76,7 +76,7 @@ impl>> Executor { fn exec( &mut self, tree: Box, - locals: &mut Cow>) -> Result + locals: &mut Cow>>) -> Result { match *tree { ParseTree::Add(x, y) => match (self.exec(x, locals)?, self.exec(y, locals)?) { @@ -304,7 +304,7 @@ impl>> Iterator for Executor let expr = self.exprs.next(); match expr { - Some(Ok(expr)) => Some(self.exec(Box::new(expr), &mut Cow::Borrowed(&HashMap::new()))), + Some(Ok(expr)) => Some(self.exec(Box::new(expr), &mut Cow::Borrowed(&Box::new(HashMap::new())))), Some(Err(e)) => Some(Err(RuntimeError::ParseError(e))), None => None, }