about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/trivially_copy_pass_by_ref.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/clippy_lints/src/trivially_copy_pass_by_ref.rs b/clippy_lints/src/trivially_copy_pass_by_ref.rs
index d811ce4ecb9..2929752bbb2 100644
--- a/clippy_lints/src/trivially_copy_pass_by_ref.rs
+++ b/clippy_lints/src/trivially_copy_pass_by_ref.rs
@@ -153,9 +153,8 @@ impl<'a, 'tcx> TriviallyCopyPassByRef {
         trait_items: &[TraitItemRef]
     ) {
         for item in trait_items {
-            match item.kind {
-                AssociatedItemKind::Method{..} => self.check_trait_method(cx, item),
-                _ => (),
+            if let AssociatedItemKind::Method{..} = item.kind {
+                self.check_trait_method(cx, item);
             }
         }
     }
@@ -172,9 +171,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
         if in_macro(item.span) {
             return;
         }
-        match item.node {
-            ItemKind::Trait(_, _, _, _, ref trait_items) => self.check_trait_items(cx, trait_items),
-            _ => (),
+        if let ItemKind::Trait(_, _, _, _, ref trait_items) = item.node {
+            self.check_trait_items(cx, trait_items);
         }
     }