diff --git a/src/run.rs b/src/run.rs index e7507e0..9403afb 100644 --- a/src/run.rs +++ b/src/run.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, collections::HashMap, fmt::Debug, rc::Rc}; +use std::{collections::HashMap, fmt::Debug, rc::Rc}; use crate::{ ast::{Constant, Expression, Location}, @@ -41,11 +41,11 @@ impl Scope { self.variables.get(name.as_ref()).cloned() } - pub fn set(&mut self, name: Cow, value: Value) { + pub fn set(&mut self, name: String, value: Value) { if let Some(value) = value { - self.variables.insert(name.into(), value); + self.variables.insert(name, value); } else { - self.variables.remove(name.as_ref()); + self.variables.remove(&name); } } }