diff --git a/examples/foo.rs b/examples/foo.rs index ae58e43a..5bfe89e3 100644 --- a/examples/foo.rs +++ b/examples/foo.rs @@ -149,9 +149,10 @@ fn eval<'a>( .zip(arg_names.iter()) .map(|(val, name)| Ok((*name, val?))) .collect::>()?; + let old_vars = vars.len(); vars.append(&mut args); let output = eval(body, vars, funcs); - vars.truncate(vars.len() - args.len()); + vars.truncate(old_vars); output } else { Err(format!(