Refine auto_restore syntax.

This commit is contained in:
Stephen Chung
2022-12-04 22:47:10 +08:00
parent 3163d9d1d6
commit e2bd0705b1
7 changed files with 64 additions and 32 deletions

View File

@@ -352,7 +352,7 @@ fn test_call_fn_events() -> Result<(), Box<EvalAltResult>> {
let mut handler = Handler::new();
assert!(!handler.scope.get_value::<bool>("state").unwrap());
handler.on_event("update", 999);
let _ = handler.on_event("update", 999);
assert!(handler.scope.get_value::<bool>("state").unwrap());
assert_eq!(handler.on_event("start", 999).as_int().unwrap(), 1041);