From 76d3f5560613b51e478200c3a3e693de9b0a2403 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 12 Jun 2021 15:09:54 +0100 Subject: [PATCH] Implement divassign for vector 2d --- agb/src/number.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agb/src/number.rs b/agb/src/number.rs index 99b2a6c9..8f354b5e 100644 --- a/agb/src/number.rs +++ b/agb/src/number.rs @@ -491,6 +491,14 @@ impl> Div for Vector2D { } } +impl> DivAssign for Vector2D { + fn div_assign(&mut self, rhs: U) { + let result = *self / rhs; + self.x = result.x; + self.y = result.y; + } +} + #[test_case] fn test_vector_multiplication_and_division(_gba: &mut super::Gba) { let a: Vector2D = (1, 2).into();