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

@@ -77,7 +77,7 @@ fn test_plugins_package() -> Result<(), Box<EvalAltResult>> {
let mut m = Module::new();
combine_with_exported_module!(&mut m, "test", test::special_array_package);
engine.register_global_module(m);
engine.register_global_module(m.into());
reg_functions!(engine += greet::single(INT, bool, char));
@@ -95,7 +95,7 @@ fn test_plugins_package() -> Result<(), Box<EvalAltResult>> {
"6 kitties"
);
engine.register_static_module("test", exported_module!(test::special_array_package));
engine.register_static_module("test", exported_module!(test::special_array_package).into());
assert_eq!(engine.eval::<INT>("test::MYSTIC_NUMBER")?, 42);