Use ? operator in tests.

This commit is contained in:
Stephen Chung
2020-03-09 21:09:53 +08:00
parent 63482d5a79
commit 5b5fd162be
6 changed files with 51 additions and 28 deletions

View File

@@ -4,7 +4,7 @@ use rhai::{Engine, EvalAltResult};
fn test_engine_call_fn() -> Result<(), EvalAltResult> {
let mut engine = Engine::new();
let ast = Engine::compile("fn hello(x, y) { x.len() + y }")?;
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))?;