about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAda Alakbarova <ada.alakbarova@proton.me>2025-08-20 01:16:23 +0200
committerAda Alakbarova <ada.alakbarova@proton.me>2025-08-22 15:03:18 +0200
commit58b646239d2ad0f757eb6930e0bb42ad69bcac15 (patch)
treee8f297474fafe1280b1d1cc71041bc8f74bb57eb
parent6cf7634323374cfbd618c5bd3ca7040cfdf96f55 (diff)
downloadrust-58b646239d2ad0f757eb6930e0bb42ad69bcac15.tar.gz
rust-58b646239d2ad0f757eb6930e0bb42ad69bcac15.zip
misc: don't bother checking the other case
`trait_name` can only be _one_ of those at the same time
-rw-r--r--clippy_lints/src/non_canonical_impls.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/clippy_lints/src/non_canonical_impls.rs b/clippy_lints/src/non_canonical_impls.rs
index 19fd1925e90..ba67dc62abb 100644
--- a/clippy_lints/src/non_canonical_impls.rs
+++ b/clippy_lints/src/non_canonical_impls.rs
@@ -171,12 +171,8 @@ impl LateLintPass<'_> for NonCanonicalImpls {
                     String::new(),
                     Applicability::MaybeIncorrect,
                 );
-
-                return;
             }
-        }
-
-        if trait_name == Some(sym::PartialOrd)
+        } else if trait_name == Some(sym::PartialOrd)
             && impl_item.ident.name == sym::partial_cmp
             && let Some(ord_def_id) = cx.tcx.get_diagnostic_item(sym::Ord)
             && implements_trait(cx, trait_impl.self_ty(), ord_def_id, &[])