Reimplement import merging by making it recursive properly nesting all levels

This commit is contained in:
Lukas Wirth 2020-09-12 19:18:14 +02:00
parent c8623461a5
commit a898752881
4 changed files with 262 additions and 81 deletions

View file

@ -347,6 +347,7 @@ impl ast::UseTree {
self.clone()
}
/// Splits off the given prefix, making it the path component of the use tree, appending the rest of the path to all UseTreeList items.
#[must_use]
pub fn split_prefix(&self, prefix: &ast::Path) -> ast::UseTree {
let suffix = if self.path().as_ref() == Some(prefix) && self.use_tree_list().is_none() {