Code cleanup.

This commit is contained in:
Stephen Chung
2022-10-29 10:40:07 +08:00
parent 6ce1dae110
commit 6af66d3ed3
5 changed files with 28 additions and 33 deletions

View File

@@ -309,13 +309,7 @@ fn main() {
}
// Register sample functions
engine
.register_global_module(exported_module!(sample_functions).into())
.register_get_set(
"test",
|x: &mut INT| *x % 2 == 0,
|x: &mut INT, y: bool| if y { *x *= 2 } else { *x /= 2 },
);
engine.register_global_module(exported_module!(sample_functions).into());
// Create scope
let mut scope = Scope::new();