Simplify UseTree::has_comment

This commit is contained in:
Seiichi Uchida 2018-04-06 23:03:11 +09:00 committed by Seiichi Uchida
parent 1954513ace
commit 4a7e45ec28

View File

@ -446,9 +446,7 @@ impl UseTree {
}
fn has_comment(&self) -> bool {
self.list_item.as_ref().map_or(false, |list_item| {
list_item.pre_comment.is_some() || list_item.post_comment.is_some()
})
self.list_item.as_ref().map_or(false, ListItem::has_comment)
}
fn same_visibility(&self, other: &UseTree) -> bool {
@ -526,7 +524,6 @@ impl UseTree {
if *a == b {
len = i + 1;
new_path.push(b);
continue;
} else {
len = i;
break;