rewrite merge use trees assist to use muatable syntax trees

changelog internal
This commit is contained in:
Aleksey Kladov 2021-03-18 12:57:55 +03:00
parent d834306e7c
commit 9cbf09ec4f
7 changed files with 116 additions and 83 deletions

View file

@ -213,7 +213,7 @@ pub fn try_merge_imports(
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))
Some(lhs.with_use_tree(merged).clone_for_update())
}
pub fn try_merge_trees(
@ -234,7 +234,7 @@ pub fn try_merge_trees(
} else {
(lhs.split_prefix(&lhs_prefix), rhs.split_prefix(&rhs_prefix))
};
recursive_merge(&lhs, &rhs, merge)
recursive_merge(&lhs, &rhs, merge).map(|it| it.clone_for_update())
}
/// Recursively "zips" together lhs and rhs.