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

@@ -47,9 +47,8 @@ impl Engine {
fn_def
.lib
.as_ref()
.and_then(|m| m.id().map(|id| id.to_string()))
.or_else(|| global.source.as_ref().map(|s| s.to_string()))
.unwrap_or_default(),
.and_then(|m| m.id().map(str::to_string))
.unwrap_or_else(|| global.source.to_string()),
err,
pos,
)