File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
backend/parsers/windmill-parser-py-imports/src Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -122,18 +122,16 @@ fn parse_code_for_imports(code: &str, path: &str) -> error::Result<Vec<String>>
122
122
let nimports: Vec < String > = ast
123
123
. into_iter ( )
124
124
. filter_map ( |x| match x {
125
- Stmt :: Import ( StmtImport { names, range } ) => find_pin ( range)
126
- . and_then ( |e| if names. len ( ) > 1 { None } else { Some ( e) } )
127
- . or ( Some (
128
- names
129
- . into_iter ( )
130
- . map ( |x| {
131
- let name = x. name . to_string ( ) ;
132
- process_import ( Some ( name) , path, 0 )
133
- } )
134
- . flatten ( )
135
- . collect :: < Vec < String > > ( ) ,
136
- ) ) ,
125
+ Stmt :: Import ( StmtImport { names, range } ) => find_pin ( range) . or ( Some (
126
+ names
127
+ . into_iter ( )
128
+ . map ( |x| {
129
+ let name = x. name . to_string ( ) ;
130
+ process_import ( Some ( name) , path, 0 )
131
+ } )
132
+ . flatten ( )
133
+ . collect :: < Vec < String > > ( ) ,
134
+ ) ) ,
137
135
Stmt :: ImportFrom ( StmtImportFrom { level : Some ( i) , module, .. } ) if i. to_u32 ( ) > 0 => {
138
136
Some ( process_import (
139
137
module. map ( |x| x. to_string ( ) ) ,
You can’t perform that action at this time.
0 commit comments