Minor refactor.

This commit is contained in:
Stephen Chung
2022-03-27 21:53:50 +08:00
parent 5caf20d26b
commit 6369fa5c65
5 changed files with 10 additions and 11 deletions

View File

@@ -178,7 +178,7 @@ impl Engine {
#[cfg(not(feature = "no_closure"))]
crate::func::call::ensure_no_data_race(name, &mut args, false)?;
let result = self.call_script_fn(
self.call_script_fn(
scope,
global,
state,
@@ -189,8 +189,6 @@ impl Engine {
rewind_scope,
Position::NONE,
0,
);
result
)
}
}

View File

@@ -227,9 +227,9 @@ impl Engine {
ast.as_ref(),
];
let lib = if lib.first().map(|m: &&Module| m.is_empty()).unwrap_or(true) {
&lib[0..0]
&[]
} else {
&lib
&lib[..]
};
self.eval_global_statements(scope, global, &mut state, statements, lib, level)
}