I have a collection of generic functions of the following form:
fn square<T>(i: T) -> T
where
T:std::ops::Mul + std::ops::Mul<Output = T> + Copy {
i*i
}
since the number of types of this collection has gotten longer I would like to collect them in a name that can be curated at one position in the code; for the normal traits that works fine, eg:
trait TraitCollection: Debug + std::ops::Mul {}
impl<T: Debug + std::ops::Mul> TraitCollection for T {}
TraitCollection now has all methods of Debug and std::ops::Mul. But how do I incoroporate std::ops::Mul<Output = T> in this?