diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2024-05-22 14:28:07 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2024-05-22 14:46:33 +0200 |
| commit | b1830a5fe64d50cb819830400c51ccac558bbdf4 (patch) | |
| tree | 15a41b871f1d26122f045b1f87cf9a6af1b7e23d /src/tools/rust-analyzer/crates/ide-db | |
| parent | b29c755572685ee3fae302c7bcf2b25006e01d8e (diff) | |
| download | rust-b1830a5fe64d50cb819830400c51ccac558bbdf4.tar.gz rust-b1830a5fe64d50cb819830400c51ccac558bbdf4.zip | |
Update assists test fixtures
Diffstat (limited to 'src/tools/rust-analyzer/crates/ide-db')
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs b/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs index 5e33b08e4a4..530020f1168 100644 --- a/src/tools/rust-analyzer/crates/ide-db/src/imports/import_assets.rs +++ b/src/tools/rust-analyzer/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 { |
