Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/imports/import_assets.rs')
-rw-r--r--crates/ide-db/src/imports/import_assets.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/crates/ide-db/src/imports/import_assets.rs b/crates/ide-db/src/imports/import_assets.rs
index 5e33b08e4a..530020f116 100644
--- a/crates/ide-db/src/imports/import_assets.rs
+++ b/crates/ide-db/src/imports/import_assets.rs
@@ -637,13 +637,17 @@ fn get_mod_path(
prefer_no_std: bool,
prefer_prelude: bool,
) -> Option<ModPath> {
- module_with_candidate.find_use_path(
- db,
- item_to_search,
- prefixed.unwrap_or(PrefixKind::Plain),
- prefer_no_std,
- prefer_prelude,
- )
+ if let Some(prefix_kind) = prefixed {
+ module_with_candidate.find_use_path(
+ db,
+ item_to_search,
+ prefix_kind,
+ prefer_no_std,
+ prefer_prelude,
+ )
+ } else {
+ module_with_candidate.find_path(db, item_to_search, prefer_no_std, prefer_prelude)
+ }
}
impl ImportCandidate {