diff --git a/lykiadb-server/src/engine/interpreter.rs b/lykiadb-server/src/engine/interpreter.rs index 625a26d..dadf2fa 100644 --- a/lykiadb-server/src/engine/interpreter.rs +++ b/lykiadb-server/src/engine/interpreter.rs @@ -198,7 +198,7 @@ impl Interpreter { } Interpreter { env: root_env.clone(), - root_env: root_env, + root_env, loop_stack: LoopStack::new(), source_processor: SourceProcessor::new(), current_program: None, diff --git a/lykiadb-server/src/value/environment.rs b/lykiadb-server/src/value/environment.rs index 0460a21..f43bae2 100644 --- a/lykiadb-server/src/value/environment.rs +++ b/lykiadb-server/src/value/environment.rs @@ -82,7 +82,7 @@ impl EnvironmentFrame { // TODO(vck): Remove clone return Ok(self.map.read().unwrap().get(key_sym).unwrap().clone()); } - return self.parent.as_ref().map_or( + self.parent.as_ref().map_or( Err(HaltReason::Error( EnvironmentError::Other { message: format!("Variable '{}' was not found", key), @@ -90,7 +90,7 @@ impl EnvironmentFrame { .into(), )), |parent| parent.read(key, key_sym), - ); + ) } pub fn read_at( @@ -103,7 +103,7 @@ impl EnvironmentFrame { .map .read() .unwrap() - .get(&key_sym) + .get(key_sym) .map_or( Err(HaltReason::Error( EnvironmentError::Other {