Skip to content

Commit ecd8d09

Browse files
committed
Fix bug preventing import built-in function from working correctly
1 parent 7d6137c commit ecd8d09

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ mod strings;
99
use std::cell::RefCell;
1010
use std::io::ErrorKind;
1111
use std::path::Path;
12+
use std::process;
1213
use std::rc::Rc;
13-
use std::{mem, process};
1414

1515
use crate::lexer::Lexer;
1616
use crate::parser::Parser;
@@ -137,9 +137,9 @@ pub fn import(args: Vec<Value>) -> Result<Value, RuntimeError> {
137137
.map_err(|_| RuntimeError::Message("import: could not tokenize source"))?;
138138
}
139139

140-
let mut env_ref = env.borrow_mut();
140+
let env_ref = env.borrow();
141141

142-
Ok(Value::Record(mem::take(&mut env_ref.vars)))
142+
Ok(Value::Record(env_ref.vars.clone()))
143143
}
144144
},
145145

0 commit comments

Comments
 (0)