aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-16 21:29:11 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-16 21:29:11 +0100
commit6801bea82458ab50e6d81b3bb3f3aac7b2f93ed6 (patch)
treeafe7f431a888a3e11dfb29692ed9be0623c8bb6d
parentef47ba4e8bdec20a57f325efd129cc3e183e0b98 (diff)
downloadsylt-6801bea82458ab50e6d81b3bb3f3aac7b2f93ed6.tar.gz
let some fix
-rw-r--r--src/compiler.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler.rs b/src/compiler.rs
index 361d93a..be99b01 100644
--- a/src/compiler.rs
+++ b/src/compiler.rs
@@ -630,8 +630,8 @@ impl Compiler {
Value::Function(_, b) if b.borrow().name == name => Some(i),
_ => None,
});
- if res.is_some() {
- return res.unwrap();
+ if let Some(res) = res {
+ return res;
}
let constant = self.add_constant(Value::Nil);
let line = self.line();