Skip to content

Commit b15751d

Browse files
committed
misc: don't bother checking the other case
`trait_name` can only be _one_ of those at the same time
1 parent 5e1ed8e commit b15751d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clippy_lints/src/non_canonical_impls.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,8 @@ impl LateLintPass<'_> for NonCanonicalImpls {
171171
String::new(),
172172
Applicability::MaybeIncorrect,
173173
);
174-
175-
return;
176174
}
177-
}
178-
179-
if trait_name == Some(sym::PartialOrd)
175+
} else if trait_name == Some(sym::PartialOrd)
180176
&& impl_item.ident.name == sym::partial_cmp
181177
&& let Some(ord_def_id) = cx.tcx.get_diagnostic_item(sym::Ord)
182178
&& implements_trait(cx, trait_impl.self_ty(), ord_def_id, &[])

0 commit comments

Comments
 (0)