mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-14 16:03:17 +00:00
Simplify UseTree::has_comment
This commit is contained in:
parent
1954513ace
commit
4a7e45ec28
@ -446,9 +446,7 @@ impl UseTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn has_comment(&self) -> bool {
|
fn has_comment(&self) -> bool {
|
||||||
self.list_item.as_ref().map_or(false, |list_item| {
|
self.list_item.as_ref().map_or(false, ListItem::has_comment)
|
||||||
list_item.pre_comment.is_some() || list_item.post_comment.is_some()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn same_visibility(&self, other: &UseTree) -> bool {
|
fn same_visibility(&self, other: &UseTree) -> bool {
|
||||||
@ -526,7 +524,6 @@ impl UseTree {
|
|||||||
if *a == b {
|
if *a == b {
|
||||||
len = i + 1;
|
len = i + 1;
|
||||||
new_path.push(b);
|
new_path.push(b);
|
||||||
continue;
|
|
||||||
} else {
|
} else {
|
||||||
len = i;
|
len = i;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user