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 10, 2018
1 parent 1954513 commit 4a7e45e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -526,7 +524,6 @@ impl UseTree {
if *a == b {
len = i + 1;
new_path.push(b);
continue;
} else {
len = i;
break;
Expand Down

0 comments on commit 4a7e45e

Please sign in to comment.