diff options
| author | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-08-20 01:16:23 +0200 |
|---|---|---|
| committer | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-08-22 15:03:18 +0200 |
| commit | 58b646239d2ad0f757eb6930e0bb42ad69bcac15 (patch) | |
| tree | e8f297474fafe1280b1d1cc71041bc8f74bb57eb | |
| parent | 6cf7634323374cfbd618c5bd3ca7040cfdf96f55 (diff) | |
| download | rust-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.rs | 6 |
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, &[]) |
