File tree Expand file tree Collapse file tree 4 files changed +16
-19
lines changed
Expand file tree Collapse file tree 4 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,10 @@ rustpython-pylib = { path = "pylib" }
2929rustpython-stdlib = { path = " stdlib" }
3030rustpython-doc = { git = " https://github.com/RustPython/__doc__" , branch = " main" }
3131
32- rustpython-literal = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " aa101e4f2693624eddabe35eaf3067bba65331df " }
33- rustpython-parser-core = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " aa101e4f2693624eddabe35eaf3067bba65331df " }
34- rustpython-parser = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " aa101e4f2693624eddabe35eaf3067bba65331df " }
35- rustpython-ast = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " aa101e4f2693624eddabe35eaf3067bba65331df " }
32+ rustpython-literal = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " 5b2af304a2baa53598e594097824165d4ac7a119 " }
33+ rustpython-parser-core = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " 5b2af304a2baa53598e594097824165d4ac7a119 " }
34+ rustpython-parser = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " 5b2af304a2baa53598e594097824165d4ac7a119 " }
35+ rustpython-ast = { git = " https://github.com/youknowone/RustPython-parser.git" , rev = " 5b2af304a2baa53598e594097824165d4ac7a119 " }
3636# rustpython-literal = { path = "../RustPython-parser/literal" }
3737# rustpython-parser-core = { path = "../RustPython-parser/core" }
3838# rustpython-parser = { path = "../RustPython-parser/parser" }
Original file line number Diff line number Diff line change @@ -582,16 +582,16 @@ impl Compiler {
582582 value : num_traits:: Zero :: zero ( ) ,
583583 } ) ;
584584 self . emit_constant ( ConstantData :: None ) ;
585- let idx = self . name ( name. name . as_str ( ) ) ;
585+ let idx = self . name ( & name. name ) ;
586586 emit ! ( self , Instruction :: ImportName { idx } ) ;
587587 if let Some ( alias) = & name. asname {
588- for part in name. name . as_str ( ) . split ( '.' ) . skip ( 1 ) {
588+ for part in name. name . split ( '.' ) . skip ( 1 ) {
589589 let idx = self . name ( part) ;
590590 emit ! ( self , Instruction :: LoadAttr { idx } ) ;
591591 }
592592 self . store_name ( alias. as_str ( ) ) ?
593593 } else {
594- self . store_name ( name. name . as_str ( ) . split ( '.' ) . next ( ) . unwrap ( ) ) ?
594+ self . store_name ( name. name . split ( '.' ) . next ( ) . unwrap ( ) ) ?
595595 }
596596 }
597597 }
@@ -600,7 +600,7 @@ impl Compiler {
600600 module,
601601 names,
602602 } ) => {
603- let import_star = names. iter ( ) . any ( |n| n. node . name . as_str ( ) == "*" ) ;
603+ let import_star = names. iter ( ) . any ( |n| & n. node . name == "*" ) ;
604604
605605 let from_list = if import_star {
606606 if self . ctx . in_func ( ) {
Original file line number Diff line number Diff line change @@ -646,7 +646,7 @@ impl SymbolTableBuilder {
646646 if let ImportFrom ( StmtImportFrom { module, names, .. } ) = & statement. node {
647647 if module. as_ref ( ) . map ( |id| id. as_str ( ) ) == Some ( "__future__" ) {
648648 for feature in names {
649- if feature. node . name . as_str ( ) == "annotations" {
649+ if & feature. node . name == "annotations" {
650650 self . future_annotations = true ;
651651 }
652652 }
@@ -752,7 +752,7 @@ impl SymbolTableBuilder {
752752 } else {
753753 // `import module`
754754 self . register_name (
755- name. node . name . as_str ( ) . split ( '.' ) . next ( ) . unwrap ( ) ,
755+ name. node . name . split ( '.' ) . next ( ) . unwrap ( ) ,
756756 SymbolUsage :: Imported ,
757757 location,
758758 ) ?;
You can’t perform that action at this time.
0 commit comments