Closed leftiness closed 8 years ago
point + point requires type Point. Type &Point doesn't work, so I've been using point.clone() to get around that. There's apparently a better way.
http://stackoverflow.com/questions/36873837/choose-to-borrow-or-pass-ownership-without-duplicating-code-in-rust
... same for subtraction.
Nah. Idk what that Borrow<> bit is, but the real solution is to just impl Add for &Point and then &Point + &Point.
point + point requires type Point. Type &Point doesn't work, so I've been using point.clone() to get around that. There's apparently a better way.
http://stackoverflow.com/questions/36873837/choose-to-borrow-or-pass-ownership-without-duplicating-code-in-rust
... same for subtraction.