Skip to content

Commit 5155f1e

Browse files
committed
Simplify UseTree::has_comment
1 parent e5553a9 commit 5155f1e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/imports.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,7 @@ impl UseTree {
441441
}
442442

443443
fn has_comment(&self) -> bool {
444-
self.list_item.as_ref().map_or(false, |list_item| {
445-
list_item.pre_comment.is_some() || list_item.post_comment.is_some()
446-
})
444+
self.list_item.as_ref().map_or(false, ListItem::has_comment)
447445
}
448446

449447
fn same_visibility(&self, other: &UseTree) -> bool {
@@ -521,7 +519,6 @@ impl UseTree {
521519
if *a == b {
522520
len = i + 1;
523521
new_path.push(b);
524-
continue;
525522
} else {
526523
len = i;
527524
break;

0 commit comments

Comments
 (0)