Change call_fn_raw to call_fn_with_options.

This commit is contained in:
Stephen Chung
2022-11-21 23:42:29 +08:00
parent 3feff3618a
commit d151c87687
18 changed files with 387 additions and 233 deletions

View File

@@ -121,7 +121,7 @@ pub fn main() {
let mut fields = input.trim().splitn(2, ' ');
let event = fields.next().expect("event").trim();
let arg = fields.next().unwrap_or("");
let arg = fields.next().unwrap_or("").to_string();
// Process event
match event {
@@ -138,7 +138,7 @@ pub fn main() {
let scope = &mut handler.scope;
let ast = &handler.ast;
let result = engine.call_fn::<()>(scope, ast, event, (arg.to_string(),));
let result = engine.call_fn::<()>(scope, ast, event, (arg,));
if let Err(err) = result {
eprintln!("! {err}")