This commit is contained in:
Nathan Sobo
2021-07-19 13:59:07 -06:00
parent 5a33612f0f
commit e193a660aa
5 changed files with 39 additions and 15 deletions
+6
View File
@@ -72,6 +72,12 @@ impl Sub for Point {
impl<'a> AddAssign<&'a Self> for Point {
fn add_assign(&mut self, other: &'a Self) {
*self += *self;
}
}
impl AddAssign<Self> for Point {
fn add_assign(&mut self, other: Self) {
if other.row == 0 {
self.column += other.column;
} else {