aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-18 09:57:55 +0000
committerAleksey Kladov <[email protected]>2021-03-22 17:47:46 +0000
commit9cbf09ec4f24aa30af1d9855a909a6cfc67188f7 (patch)
tree20057e98e523440ebc3120e1e3c104b306a97baf /crates/ide_db/src
parentd834306e7cf85fe0b07e4979d2ff39bf4ef1f6be (diff)
rewrite merge use trees assist to use muatable syntax trees
changelog internal
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r--crates/ide_db/src/helpers/insert_use.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_db/src/helpers/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs
index 37acf95f0..20c195f82 100644
--- a/crates/ide_db/src/helpers/insert_use.rs
+++ b/crates/ide_db/src/helpers/insert_use.rs
@@ -213,7 +213,7 @@ pub fn try_merge_imports(
213 let lhs_tree = lhs.use_tree()?; 213 let lhs_tree = lhs.use_tree()?;
214 let rhs_tree = rhs.use_tree()?; 214 let rhs_tree = rhs.use_tree()?;
215 let merged = try_merge_trees(&lhs_tree, &rhs_tree, merge_behavior)?; 215 let merged = try_merge_trees(&lhs_tree, &rhs_tree, merge_behavior)?;
216 Some(lhs.with_use_tree(merged)) 216 Some(lhs.with_use_tree(merged).clone_for_update())
217} 217}
218 218
219pub fn try_merge_trees( 219pub fn try_merge_trees(
@@ -234,7 +234,7 @@ pub fn try_merge_trees(
234 } else { 234 } else {
235 (lhs.split_prefix(&lhs_prefix), rhs.split_prefix(&rhs_prefix)) 235 (lhs.split_prefix(&lhs_prefix), rhs.split_prefix(&rhs_prefix))
236 }; 236 };
237 recursive_merge(&lhs, &rhs, merge) 237 recursive_merge(&lhs, &rhs, merge).map(|it| it.clone_for_update())
238} 238}
239 239
240/// Recursively "zips" together lhs and rhs. 240/// Recursively "zips" together lhs and rhs.