Skip to content

Commit 1fed72b

Browse files
committed
Address 'clippy::single-match' dogfood lint
1 parent d4a6ee4 commit 1fed72b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clippy_lints/src/trivially_copy_pass_by_ref.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ impl<'a, 'tcx> TriviallyCopyPassByRef {
153153
trait_items: &[TraitItemRef]
154154
) {
155155
for item in trait_items {
156-
match item.kind {
157-
AssociatedItemKind::Method{..} => self.check_trait_method(cx, item),
158-
_ => (),
156+
if let AssociatedItemKind::Method{..} = item.kind {
157+
self.check_trait_method(cx, item);
159158
}
160159
}
161160
}
@@ -172,9 +171,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
172171
if in_macro(item.span) {
173172
return;
174173
}
175-
match item.node {
176-
ItemKind::Trait(_, _, _, _, ref trait_items) => self.check_trait_items(cx, trait_items),
177-
_ => (),
174+
if let ItemKind::Trait(_, _, _, _, ref trait_items) = item.node {
175+
self.check_trait_items(cx, trait_items);
178176
}
179177
}
180178

0 commit comments

Comments
 (0)