Closed
Description
For a trait like this
trait LotsOfBounds
where
Self: Clone + Copy + Default + Ord,
Self: Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign,
Self: Mul<Output = Self> + MulAssign + Div<Output = Self> + DivAssign,
{
}
type_repetition_in_bounds
recommends combining all the traits, which would lead to either a very long line or to many many lines:
trait LotsOfBounds
where
Self: Clone
+ Copy
+ Default
+ Ord
+ Add<Output = Self>
+ AddAssign
+ Sub<Output = Self>
+ SubAssign
+ Mul<Output = Self>
+ MulAssign
+ Div<Output = Self>
+ DivAssign
{
}
The logical grouping in the original example makes it more readable, and it is lost with the clippy suggestion.