Simplify if let.

This commit is contained in:
Stephen Chung
2021-12-12 12:33:22 +08:00
parent 3a5495a65c
commit 780c36e675
5 changed files with 32 additions and 36 deletions

View File

@@ -577,11 +577,12 @@ impl Engine {
}
let mut empty_scope;
let scope = if let Some(scope) = _scope {
scope
} else {
empty_scope = Scope::new();
&mut empty_scope
let scope = match _scope {
Some(scope) => scope,
None => {
empty_scope = Scope::new();
&mut empty_scope
}
};
let result = if _is_method_call {