From 291333444f00bbf96dd1f60fb9058025916ac66a Mon Sep 17 00:00:00 2001 From: numzero Date: Fri, 11 Apr 2025 19:54:10 +0300 Subject: [PATCH] simplify scopes --- src/run.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/run.rs b/src/run.rs index 5f99450..c84a4c6 100644 --- a/src/run.rs +++ b/src/run.rs @@ -32,7 +32,7 @@ impl Debug for Function { #[derive(Debug, Clone, Default)] pub struct Scope { - pub variables: HashMap, + pub variables: HashMap, pub functions: HashMap, } @@ -54,7 +54,7 @@ impl Eval for Constant { impl Eval for Location { fn eval(&self, scope: &mut Scope) -> Value { match self { - Location::Variable { name } => scope.variables.get(name).cloned().flatten(), + Location::Variable { name } => scope.variables.get(name).cloned(), Location::Field { table, index } => { let table = table.eval(scope); let Some(ValueInner::Table(table)) = table else {