Engine::register_global_module and Engine::register_static_module must be passed shared Module.

This commit is contained in:
Stephen Chung
2020-12-23 10:08:43 +08:00
parent 15fb03218c
commit f55a56c6bc
11 changed files with 23 additions and 22 deletions

View File

@@ -44,7 +44,7 @@ fn test_module_sub_module() -> Result<(), Box<EvalAltResult>> {
assert_eq!(m2.get_var_value::<INT>("answer").unwrap(), 41);
let mut engine = Engine::new();
engine.register_static_module("question", module);
engine.register_static_module("question", module.into());
assert_eq!(engine.eval::<INT>("question::MYSTIC_NUMBER")?, 42);
assert!(engine.eval::<INT>("MYSTIC_NUMBER").is_err());