diff options
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/helpers/merge_imports.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ide_db/src/helpers/merge_imports.rs b/crates/ide_db/src/helpers/merge_imports.rs index 475ef99b5..8fb40e837 100644 --- a/crates/ide_db/src/helpers/merge_imports.rs +++ b/crates/ide_db/src/helpers/merge_imports.rs | |||
@@ -42,10 +42,12 @@ pub fn try_merge_imports( | |||
42 | return None; | 42 | return None; |
43 | } | 43 | } |
44 | 44 | ||
45 | let lhs = lhs.clone_subtree().clone_for_update(); | ||
45 | let lhs_tree = lhs.use_tree()?; | 46 | let lhs_tree = lhs.use_tree()?; |
46 | let rhs_tree = rhs.use_tree()?; | 47 | let rhs_tree = rhs.use_tree()?; |
47 | let merged = try_merge_trees(&lhs_tree, &rhs_tree, merge_behavior)?; | 48 | let merged = try_merge_trees(&lhs_tree, &rhs_tree, merge_behavior)?; |
48 | Some(lhs.with_use_tree(merged).clone_for_update()) | 49 | ted::replace(lhs_tree.syntax(), merged.syntax()); |
50 | Some(lhs) | ||
49 | } | 51 | } |
50 | 52 | ||
51 | pub fn try_merge_trees( | 53 | pub fn try_merge_trees( |