From 4f560965714a285e2a40a9a1349ec5f750abf430 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Mon, 17 Aug 2020 04:01:25 -0400 Subject: [PATCH] simplify `default_var_exists` --- src/scope.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/scope.rs b/src/scope.rs index f252941..a70f843 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -90,11 +90,7 @@ impl Scope { pub fn default_var_exists(&mut self, s: Identifier) -> bool { if let Some(default_var) = self.get_var_no_err(s) { - if default_var.is_null() { - false - } else { - true - } + !default_var.is_null() } else { false }