Skip to content

Commit e61fa6d

Browse files
committed
Use Iterator to create from_list
1 parent 4938c03 commit e61fa6d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

vm/src/frame.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -908,10 +908,10 @@ impl Frame {
908908
}
909909

910910
fn import(&self, vm: &VirtualMachine, module: &str, symbols: &Vec<String>) -> FrameResult {
911-
let mut from_list = vec![];
912-
for symbol in symbols {
913-
from_list.push(vm.ctx.new_str(symbol.to_string()));
914-
}
911+
let from_list = symbols
912+
.iter()
913+
.map(|symbol| vm.ctx.new_str(symbol.to_string()))
914+
.collect();
915915
let module = vm.import(module, &vm.ctx.new_tuple(from_list))?;
916916

917917
if symbols.is_empty() {

0 commit comments

Comments
 (0)