diff --git a/schala-lang/language/src/eval/mod.rs b/schala-lang/language/src/eval/mod.rs index 01d35b8..1464178 100644 --- a/schala-lang/language/src/eval/mod.rs +++ b/schala-lang/language/src/eval/mod.rs @@ -186,7 +186,7 @@ impl<'a> State<'a> { for stmt in stmts { ret = self.statement(stmt)?; } - Ok(ret.unwrap_or(Node::Expr(Expr::unit()))) + Ok(ret.unwrap_or_else(|| Node::Expr(Expr::unit()))) } fn expression(&mut self, node: Node) -> EvalResult {