generic parameters works in this simple case:
fn cube<T>(x: T) > T
where T: Copy + Mul<Output = T>
{
x * x * x
}
But when I use it in a more complex way it stopped working:
fn dot_productT<T>(a: Vec<T>, b: Vec<T>) > T
where T: Sum + Copy + Mul<Output = T>
{
return a.iter().zip(b.iter()).map((x, y) x*y).sum();
}
Error message:
error[E0369]: binary operation `*` cannot be applied to type `&T`
> src\main.rs:16:48

16  return a.iter().zip(b.iter()).map((x, y) x*y).sum();
 ^

note: an implementation of `std::ops::Mul` might be missing for `&T`
> src\main.rs:16:48

16  return a.iter().zip(b.iter()).map((x, y) x*y).sum();
 ^
error: aborting due to previous error
How can I fix this?