Fix call_fn to take &ast instead of ast.

This commit is contained in:
Stephen Chung
2020-03-07 00:29:45 +08:00
parent c917aa0a5a
commit ea82ee81d6
3 changed files with 8 additions and 8 deletions

View File

@@ -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);