fn mul(self,rhs: Person)->Self::Output
^^^consuming self, why?
Surely if I want to multiply "a * b" I don't want neither a nor b to be consumed...
Can I have non consuming mul operator?
fn mul(self,rhs: Person)->Self::Output
^^^consuming self, why?
Surely if I want to multiply "a * b" I don't want neither a nor b to be consumed...
Can I have non consuming mul operator?
impl<'a> Mul for &'a Type
creates a non-consuming implementation if you need it.
Normally Mul
is implemented for Copy
types though, so consuming the arguments doesn't actually do anything.