diff --git a/core/src/point.rs b/core/src/point.rs index 510f0d86..55872911 100644 --- a/core/src/point.rs +++ b/core/src/point.rs @@ -74,6 +74,16 @@ where } } +impl std::ops::AddAssign> for Point +where + T: std::ops::AddAssign, +{ + fn add_assign(&mut self, vector: Vector) { + self.x += vector.x; + self.y += vector.y; + } +} + impl std::ops::Sub> for Point where T: std::ops::Sub, @@ -88,6 +98,16 @@ where } } +impl std::ops::SubAssign> for Point +where + T: std::ops::SubAssign, +{ + fn sub_assign(&mut self, vector: Vector) { + self.x -= vector.x; + self.y -= vector.y; + } +} + impl std::ops::Sub> for Point where T: std::ops::Sub,