Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit e3b91d8

Browse files
authored
Fixed Foo example
1 parent b8fc4eb commit e3b91d8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

examples/foo.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ fn eval<'a>(
149149
.zip(arg_names.iter())
150150
.map(|(val, name)| Ok((*name, val?)))
151151
.collect::<Result<_, String>>()?;
152+
let old_vars = vars.len();
152153
vars.append(&mut args);
153154
let output = eval(body, vars, funcs);
154-
vars.truncate(vars.len() - args.len());
155+
vars.truncate(old_vars);
155156
output
156157
} else {
157158
Err(format!(

0 commit comments

Comments
 (0)