@@ -219,13 +219,13 @@ impl VirtualMachine {
219
219
self . current_frame ( ) . last_value ( )
220
220
}
221
221
222
- fn store_name ( & mut self , name : & String ) -> Option < PyResult > {
222
+ fn store_name ( & mut self , name : & str ) -> Option < PyResult > {
223
223
let obj = self . pop_value ( ) ;
224
224
self . current_frame_mut ( ) . locals . set_item ( name, obj) ;
225
225
None
226
226
}
227
227
228
- fn load_name ( & mut self , name : & String ) -> Option < PyResult > {
228
+ fn load_name ( & mut self , name : & str ) -> Option < PyResult > {
229
229
// Lookup name in scope and put it onto the stack!
230
230
let mut scope = self . current_frame ( ) . locals . clone ( ) ;
231
231
loop {
@@ -628,8 +628,8 @@ impl VirtualMachine {
628
628
}
629
629
}
630
630
631
- fn import ( & mut self , module : & String , symbol : & Option < String > ) -> Option < PyResult > {
632
- let obj = match import ( self , module, symbol) {
631
+ fn import ( & mut self , module : & str , symbol : & Option < String > ) -> Option < PyResult > {
632
+ let obj = match import ( self , & module. to_string ( ) , symbol) {
633
633
Ok ( value) => value,
634
634
Err ( value) => return Some ( Err ( value) ) ,
635
635
} ;
@@ -643,7 +643,7 @@ impl VirtualMachine {
643
643
objtype:: get_attribute ( self , obj. clone ( ) , attr_name)
644
644
}
645
645
646
- fn load_attr ( & mut self , attr_name : & String ) -> Option < PyResult > {
646
+ fn load_attr ( & mut self , attr_name : & str ) -> Option < PyResult > {
647
647
let parent = self . pop_value ( ) ;
648
648
match self . get_attribute ( parent, attr_name) {
649
649
Ok ( obj) => {
@@ -654,7 +654,7 @@ impl VirtualMachine {
654
654
}
655
655
}
656
656
657
- fn store_attr ( & mut self , attr_name : & String ) -> Option < PyResult > {
657
+ fn store_attr ( & mut self , attr_name : & str ) -> Option < PyResult > {
658
658
let parent = self . pop_value ( ) ;
659
659
let value = self . pop_value ( ) ;
660
660
parent. set_attr ( attr_name, value) ;
0 commit comments