Fix call_fn to take &ast instead of ast.
This commit is contained in:
@@ -6,7 +6,7 @@ fn test_engine_call_fn() -> Result<(), EvalAltResult> {
|
||||
|
||||
let ast = Engine::compile("fn hello(x, y) { x.len() + y }")?;
|
||||
|
||||
let result: i64 = engine.call_fn("hello", ast, (&mut String::from("abc"), &mut 123_i64))?;
|
||||
let result: i64 = engine.call_fn("hello", &ast, (&mut String::from("abc"), &mut 123_i64))?;
|
||||
|
||||
assert_eq!(result, 126);
|
||||
|
||||
|
Reference in New Issue
Block a user