use std::ops::Mul; pub struct Vec2 { pub x: T, pub y: T, } impl Vec2 { pub fn new(x: T, y: T) -> Self { Self { x, y } } } impl> Mul for Vec2 { type Output = Vec2; fn mul(self, rhs: S) -> Self::Output { Vec2 { x: self.x * rhs, y: self.y * rhs, } } }