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" }
29
29
rustpython-stdlib = { path = " stdlib" }
30
30
rustpython-doc = { git = " https://github.com/RustPython/__doc__" , branch = " main" }
31
31
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 " }
36
36
# rustpython-literal = { path = "../RustPython-parser/literal" }
37
37
# rustpython-parser-core = { path = "../RustPython-parser/core" }
38
38
# rustpython-parser = { path = "../RustPython-parser/parser" }
Original file line number Diff line number Diff line change @@ -582,16 +582,16 @@ impl Compiler {
582
582
value : num_traits:: Zero :: zero ( ) ,
583
583
} ) ;
584
584
self . emit_constant ( ConstantData :: None ) ;
585
- let idx = self . name ( name. name . as_str ( ) ) ;
585
+ let idx = self . name ( & name. name ) ;
586
586
emit ! ( self , Instruction :: ImportName { idx } ) ;
587
587
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 ) {
589
589
let idx = self . name ( part) ;
590
590
emit ! ( self , Instruction :: LoadAttr { idx } ) ;
591
591
}
592
592
self . store_name ( alias. as_str ( ) ) ?
593
593
} else {
594
- self . store_name ( name. name . as_str ( ) . split ( '.' ) . next ( ) . unwrap ( ) ) ?
594
+ self . store_name ( name. name . split ( '.' ) . next ( ) . unwrap ( ) ) ?
595
595
}
596
596
}
597
597
}
@@ -600,7 +600,7 @@ impl Compiler {
600
600
module,
601
601
names,
602
602
} ) => {
603
- let import_star = names. iter ( ) . any ( |n| n. node . name . as_str ( ) == "*" ) ;
603
+ let import_star = names. iter ( ) . any ( |n| & n. node . name == "*" ) ;
604
604
605
605
let from_list = if import_star {
606
606
if self . ctx . in_func ( ) {
Original file line number Diff line number Diff line change @@ -646,7 +646,7 @@ impl SymbolTableBuilder {
646
646
if let ImportFrom ( StmtImportFrom { module, names, .. } ) = & statement. node {
647
647
if module. as_ref ( ) . map ( |id| id. as_str ( ) ) == Some ( "__future__" ) {
648
648
for feature in names {
649
- if feature. node . name . as_str ( ) == "annotations" {
649
+ if & feature. node . name == "annotations" {
650
650
self . future_annotations = true ;
651
651
}
652
652
}
@@ -752,7 +752,7 @@ impl SymbolTableBuilder {
752
752
} else {
753
753
// `import module`
754
754
self . register_name (
755
- name. node . name . as_str ( ) . split ( '.' ) . next ( ) . unwrap ( ) ,
755
+ name. node . name . split ( '.' ) . next ( ) . unwrap ( ) ,
756
756
SymbolUsage :: Imported ,
757
757
location,
758
758
) ?;
You can’t perform that action at this time.
0 commit comments