diff options
author | Aleksey Kladov <[email protected]> | 2021-05-14 14:40:11 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-05-14 14:40:11 +0100 |
commit | 73123a7550a667ebc42be96651a8e36be482a828 (patch) | |
tree | e074fabfcdfb806685bc2fe75a976f9ce677d64d /crates/ide_db | |
parent | 873717190d2f324ffaa9222914737606eee7a03d (diff) |
internal: remove SyntaxRewriter
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( |