Closed
Description
What it does
This lint warns about repetitions of the same trait in trait bounds or where clauses.
Lint Name
repetition_where_clause_or_trait_bound
Category
pedantic
Advantage
Leaving duplicate trait bounds is less readable.
Drawbacks
None
Example
pub fn foo<T: Copy + Copy>(t: T) {}
Could be written as:
pub fn foo<T: Copy>(t: T) {}
OR
pub fn foo<T>(t: T) where T: Copy + Copy {}
Could be written as:
pub fn foo<T>(t: T) where T: Copy {}