We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5df0a3 commit a0c2da9Copy full SHA for a0c2da9
clippy_lints/src/trait_bounds.rs
@@ -334,13 +334,16 @@ fn into_comparable_trait_ref(trait_ref: &TraitRef<'_>) -> ComparableTraitRef {
334
fn rollup_traits(cx: &LateContext<'_>, bounds: &[GenericBound<'_>], msg: &str) {
335
let mut map = FxHashMap::default();
336
let mut repeated_res = false;
337
- for bound in bounds.iter().filter_map(|bound| {
+
338
+ let only_comparable_trait_refs = |bound: &GenericBound<'_>| {
339
if let GenericBound::Trait(t, _) = bound {
340
Some((into_comparable_trait_ref(&t.trait_ref), t.span))
341
} else {
342
None
343
}
- }) {
344
+ };
345
346
+ for bound in bounds.iter().filter_map(only_comparable_trait_refs) {
347
let (comparable_bound, span_direct) = bound;
348
if map.insert(comparable_bound, span_direct).is_some() {
349
repeated_res = true;
0 commit comments