diff options
author | Aleksey Kladov <[email protected]> | 2021-03-18 09:57:55 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-22 17:47:46 +0000 |
commit | 9cbf09ec4f24aa30af1d9855a909a6cfc67188f7 (patch) | |
tree | 20057e98e523440ebc3120e1e3c104b306a97baf /crates/ide_db | |
parent | d834306e7cf85fe0b07e4979d2ff39bf4ef1f6be (diff) |
rewrite merge use trees assist to use muatable syntax trees
changelog internal
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/helpers/insert_use.rs | 4 |
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 | ||
219 | pub fn try_merge_trees( | 219 | pub 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. |