File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
crates/ty_python_semantic/src Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -1551,11 +1551,11 @@ impl<'ast> Visitor<'ast> for SemanticIndexBuilder<'_, 'ast> {
15511551 ) ;
15521552 }
15531553 } else {
1554- self . imported_modules . extend (
1555- module_name
1556- . ancestors ( )
1557- . zip ( std :: iter :: repeat ( ImportKind :: ImportFrom ) ) ,
1558- ) ;
1554+ for name in module_name . ancestors ( ) {
1555+ self . imported_modules
1556+ . entry ( name )
1557+ . or_insert ( ImportKind :: ImportFrom ) ;
1558+ }
15591559 }
15601560 }
15611561 }
Original file line number Diff line number Diff line change @@ -11724,13 +11724,9 @@ impl<'db> ModuleLiteralType<'db> {
1172411724 .into_iter()
1172511725 .flat_map(|file| imported_modules(db, file))
1172611726 .filter_map(|(submodule_name, kind)| {
11727- Some((submodule_name.relative_to(self.module(db).name(db))?, kind))
11728- })
11729- .filter_map(|(relative_submodule, kind)| {
11730- relative_submodule
11731- .components()
11732- .next()
11733- .map(|module| (Name::from(module), *kind))
11727+ let relative_name = submodule_name.relative_to(self.module(db).name(db))?;
11728+ let available_attribute = relative_name.components().next()?;
11729+ Some((Name::from(available_attribute), *kind))
1173411730 })
1173511731 }
1173611732
You can’t perform that action at this time.
0 commit comments