From 73123a7550a667ebc42be96651a8e36be482a828 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 14 May 2021 16:40:11 +0300 Subject: internal: remove SyntaxRewriter --- crates/ide_db/src/helpers/merge_imports.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ide_db') 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( return None; } + let lhs = lhs.clone_subtree().clone_for_update(); let lhs_tree = lhs.use_tree()?; let rhs_tree = rhs.use_tree()?; let merged = try_merge_trees(&lhs_tree, &rhs_tree, merge_behavior)?; - Some(lhs.with_use_tree(merged).clone_for_update()) + ted::replace(lhs_tree.syntax(), merged.syntax()); + Some(lhs) } pub fn try_merge_trees( -- cgit v1.2.3