Update trait_bounds.rs

This commit is contained in:
John Kelly 2023-05-02 18:15:02 +01:00
parent b9788fef29
commit cbd0135bd2

View file

@ -206,13 +206,13 @@ fn check_ty(&mut self, cx: &LateContext<'tcx>, ty: &'tcx Ty<'tcx>) {
}
}
let fixed_trait_snippet = fixed_traits
.iter()
.filter_map(|b| snippet_opt(cx, b.span))
.collect::<Vec<_>>()
.join(" + ");
if bounds.len() != fixed_traits.len() {
let fixed_trait_snippet = fixed_traits
.iter()
.filter_map(|b| snippet_opt(cx, b.span))
.collect::<Vec<_>>()
.join(" + ");
span_lint_and_sugg(
cx,
TRAIT_DUPLICATION_IN_BOUNDS,