Skip to content

Commit

Permalink
Simplify UseTree::has_comment
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Apr 6, 2018
1 parent e5553a9 commit 5155f1e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/imports.rs
Expand Up @@ -441,9 +441,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 {
Expand Down Expand Up @@ -521,7 +519,6 @@ impl UseTree {
if *a == b {
len = i + 1;
new_path.push(b);
continue;
} else {
len = i;
break;
Expand Down

0 comments on commit 5155f1e

Please sign in to comment.