Remove Option from source and use empty string as no source.

This commit is contained in:
Stephen Chung
2022-01-01 17:20:00 +08:00
parent 8329baea29
commit 135b1f54c2
10 changed files with 118 additions and 98 deletions

View File

@@ -209,9 +209,8 @@ impl Engine {
level: usize,
) -> RhaiResult {
let mut state = EvalState::new();
if ast.source_raw().is_some() {
global.source = ast.source_raw().cloned();
}
global.source = ast.source_raw().clone();
#[cfg(not(feature = "no_module"))]
{
global.embedded_module_resolver = ast.resolver().cloned();