1 parent 7d6137c commit ecd8d09Copy full SHA for ecd8d09
1 file changed
src/builtin.rs
@@ -9,8 +9,8 @@ mod strings;
9
use std::cell::RefCell;
10
use std::io::ErrorKind;
11
use std::path::Path;
12
+use std::process;
13
use std::rc::Rc;
-use std::{mem, process};
14
15
use crate::lexer::Lexer;
16
use crate::parser::Parser;
@@ -137,9 +137,9 @@ pub fn import(args: Vec<Value>) -> Result<Value, RuntimeError> {
137
.map_err(|_| RuntimeError::Message("import: could not tokenize source"))?;
138
}
139
140
- let mut env_ref = env.borrow_mut();
+ let env_ref = env.borrow();
141
142
- Ok(Value::Record(mem::take(&mut env_ref.vars)))
+ Ok(Value::Record(env_ref.vars.clone()))
143
144
},
145
0 commit comments