diff options
Diffstat (limited to 'crates/ide_db/src/helpers')
-rw-r--r-- | crates/ide_db/src/helpers/import_assets.rs | 4 | ||||
-rw-r--r-- | crates/ide_db/src/helpers/merge_imports.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_db/src/helpers/import_assets.rs b/crates/ide_db/src/helpers/import_assets.rs index ae52dd8bb..9634d872e 100644 --- a/crates/ide_db/src/helpers/import_assets.rs +++ b/crates/ide_db/src/helpers/import_assets.rs | |||
@@ -323,7 +323,7 @@ fn import_for_item( | |||
323 | } | 323 | } |
324 | 324 | ||
325 | let segment_import = | 325 | let segment_import = |
326 | find_import_for_segment(db, original_item_candidate, &unresolved_first_segment)?; | 326 | find_import_for_segment(db, original_item_candidate, unresolved_first_segment)?; |
327 | let trait_item_to_import = item_as_assoc(db, original_item) | 327 | let trait_item_to_import = item_as_assoc(db, original_item) |
328 | .and_then(|assoc| assoc.containing_trait(db)) | 328 | .and_then(|assoc| assoc.containing_trait(db)) |
329 | .map(|trait_| ItemInNs::from(ModuleDef::from(trait_))); | 329 | .map(|trait_| ItemInNs::from(ModuleDef::from(trait_))); |
@@ -383,7 +383,7 @@ fn find_import_for_segment( | |||
383 | original_item | 383 | original_item |
384 | } else { | 384 | } else { |
385 | let matching_module = | 385 | let matching_module = |
386 | module_with_segment_name(db, &unresolved_first_segment, original_item)?; | 386 | module_with_segment_name(db, unresolved_first_segment, original_item)?; |
387 | ItemInNs::from(ModuleDef::from(matching_module)) | 387 | ItemInNs::from(ModuleDef::from(matching_module)) |
388 | }) | 388 | }) |
389 | } | 389 | } |
diff --git a/crates/ide_db/src/helpers/merge_imports.rs b/crates/ide_db/src/helpers/merge_imports.rs index 0dbabb44f..ec29476a4 100644 --- a/crates/ide_db/src/helpers/merge_imports.rs +++ b/crates/ide_db/src/helpers/merge_imports.rs | |||
@@ -124,7 +124,7 @@ fn recursive_merge( | |||
124 | .map(|tree_list| tree_list.use_trees().any(tree_is_self)) | 124 | .map(|tree_list| tree_list.use_trees().any(tree_is_self)) |
125 | .unwrap_or(false) | 125 | .unwrap_or(false) |
126 | }; | 126 | }; |
127 | match (tree_contains_self(&lhs_t), tree_contains_self(&rhs_t)) { | 127 | match (tree_contains_self(lhs_t), tree_contains_self(&rhs_t)) { |
128 | (true, false) => continue, | 128 | (true, false) => continue, |
129 | (false, true) => { | 129 | (false, true) => { |
130 | *lhs_t = rhs_t; | 130 | *lhs_t = rhs_t; |