Allow call_fn with only one parameter; consume can retain functions, eval cannot.
This commit is contained in:
@@ -4,9 +4,9 @@ fn main() -> Result<(), EvalAltResult> {
|
||||
let mut engine = Engine::new();
|
||||
let mut scope = Scope::new();
|
||||
|
||||
engine.eval_with_scope::<()>(&mut scope, false, "let x = 4 + 5")?;
|
||||
engine.eval_with_scope::<()>(&mut scope, "let x = 4 + 5")?;
|
||||
|
||||
let result = engine.eval_with_scope::<i64>(&mut scope, false, "x")?;
|
||||
let result = engine.eval_with_scope::<i64>(&mut scope, "x")?;
|
||||
|
||||
println!("result: {}", result);
|
||||
|
||||
|
@@ -67,7 +67,7 @@ fn main() {
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if let Err(err) = engine.consume(&contents) {
|
||||
if let Err(err) = engine.consume(&contents, false) {
|
||||
eprintln!("{}", padding("=", filename.len()));
|
||||
eprintln!("{}", filename);
|
||||
eprintln!("{}", padding("=", filename.len()));
|
||||
|
Reference in New Issue
Block a user