Fix edge case for ImportGranularity guessing
This commit is contained in:
@@ -259,11 +259,14 @@ impl ast::Path {
|
||||
}
|
||||
|
||||
pub fn segments(&self) -> impl Iterator<Item = ast::PathSegment> + Clone {
|
||||
// cant make use of SyntaxNode::siblings, because the returned Iterator is not clone
|
||||
successors(self.first_segment(), |p| {
|
||||
p.parent_path().parent_path().and_then(|p| p.segment())
|
||||
})
|
||||
}
|
||||
|
||||
pub fn qualifiers(&self) -> impl Iterator<Item = ast::Path> + Clone {
|
||||
successors(self.qualifier(), |p| p.qualifier())
|
||||
}
|
||||
}
|
||||
impl ast::UseTree {
|
||||
pub fn is_simple_path(&self) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user