about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-05-22 14:45:51 +0200
committerflip1995 <hello@philkrones.com>2020-05-22 14:45:51 +0200
commit6b3cf63bf568cab4f8e05ea483ad97d5ea0e2eec (patch)
tree7a9ea07db0eb39ca68b6e4db9d2af98c2a74f3d1
parentc00268d984b80e408f56b5d8180e2f1a80100c91 (diff)
Fix dogfood fallout
-rw-r--r--clippy_lints/src/methods/mod.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index 810a226b50d..32b3b7f7947 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -1496,17 +1496,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
             if let ty::Opaque(def_id, _) = ret_ty.kind {
                 // one of the associated types must be Self
                 for predicate in cx.tcx.predicates_of(def_id).predicates {
-                    match predicate.0.kind() {
-                        ty::PredicateKind::Projection(poly_projection_predicate) => {
-                            let binder = poly_projection_predicate.ty();
-                            let associated_type = binder.skip_binder();
-
-                            // walk the associated type and check for Self
-                            if contains_self_ty(associated_type) {
-                                return;
-                            }
-                        },
-                        _ => {},
+                    if let ty::PredicateKind::Projection(poly_projection_predicate) = predicate.0.kind() {
+                        let binder = poly_projection_predicate.ty();
+                        let associated_type = binder.skip_binder();
+
+                        // walk the associated type and check for Self
+                        if contains_self_ty(associated_type) {
+                            return;
+                        }
                     }
                 }
             }