no cows
This commit is contained in:
parent
382cfdd903
commit
9562da5518
|
|
@ -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<str>, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user