Minor refactors.

This commit is contained in:
Stephen Chung
2022-03-20 21:58:43 +08:00
parent 1b3d5aeb53
commit 99118fe2c3
14 changed files with 114 additions and 98 deletions

View File

@@ -952,9 +952,10 @@ impl Engine {
result => Some(result),
})
.or_else(|| {
self.module_resolver
.as_ref()
.map(|r| r.resolve_raw(self, global, &path, path_pos))
Some(
self.module_resolver
.resolve_raw(self, global, &path, path_pos),
)
})
.unwrap_or_else(|| {
Err(ERR::ErrorModuleNotFound(path.to_string(), path_pos).into())