From 4a7e45ec28fcbee14cd143402c1129d30cef39f0 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Fri, 6 Apr 2018 23:03:11 +0900 Subject: [PATCH] Simplify UseTree::has_comment --- src/imports.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/imports.rs b/src/imports.rs index 76fa7816f0d..03df4aed6af 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -446,9 +446,7 @@ pub fn normalize(mut self, do_sort: bool) -> 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 @@ fn merge(&mut self, other: UseTree) { if *a == b { len = i + 1; new_path.push(b); - continue; } else { len = i; break; -- 2.44.0