about summary refs log tree commit diff
path: root/src/interpret
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-10-23 00:49:54 +0200
committerMel <einebeere@gmail.com>2021-10-23 00:49:54 +0200
commitda14afd74e1659af6ce4553360ac5dd0ce933db8 (patch)
tree1a40d2182637d078db9e074a48cc4e3b355d865e /src/interpret
parent39b065b7b3c82218f7be5876f563b5d74ea75ee3 (diff)
downloadrabbithole-da14afd74e1659af6ce4553360ac5dd0ce933db8.tar.zst
rabbithole-da14afd74e1659af6ce4553360ac5dd0ce933db8.zip
Fix clippy warnings
Diffstat (limited to 'src/interpret')
-rw-r--r--src/interpret/scope.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interpret/scope.rs b/src/interpret/scope.rs
index de32692..d8b8f43 100644
--- a/src/interpret/scope.rs
+++ b/src/interpret/scope.rs
@@ -19,10 +19,10 @@ impl Scope {
         self.scopes.pop();
     }
 
-    pub fn set_var(&mut self, ident: &Identifier, value: Value) {
+    pub fn set_var(&mut self, ident: &str, value: Value) {
         for scope in self.scopes.iter_mut() {
             if scope.contains_key(ident) {
-                scope.insert(ident.clone(), value);
+                scope.insert(ident.to_string(), value);
                 return;
             }
         }
@@ -31,10 +31,10 @@ impl Scope {
             .scopes
             .last_mut()
             .expect("Tried accessing scope after last frame is gone.");
-        inner_scope.insert(ident.clone(), value);
+        inner_scope.insert(ident.to_string(), value);
     }
 
-    pub fn get_var(&self, ident: &Identifier) -> Option<Value> {
+    pub fn get_var(&self, ident: &str) -> Option<Value> {
         for scope in self.scopes.iter().rev() {
             if let Some(value) = scope.get(ident) {
                 return Some(value.clone());