From 4f21b40cfc1afb702f65e332b2e66dd770d69011 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Tue, 8 Jun 2021 17:18:44 +0100 Subject: [PATCH] make multiply and divide more generic --- agb/src/number.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/agb/src/number.rs b/agb/src/number.rs index 021f3dd..de0885d 100644 --- a/agb/src/number.rs +++ b/agb/src/number.rs @@ -462,22 +462,22 @@ impl Add> for Vector2D { } } -impl Mul for Vector2D { +impl> Mul for Vector2D { type Output = Vector2D; - fn mul(self, rhs: T) -> Self::Output { + fn mul(self, rhs: U) -> Self::Output { Vector2D { - x: self.x * rhs, - y: self.y * rhs, + x: self.x * rhs.into(), + y: self.y * rhs.into(), } } } -impl Div for Vector2D { +impl> Div for Vector2D { type Output = Vector2D; - fn div(self, rhs: T) -> Self::Output { + fn div(self, rhs: U) -> Self::Output { Vector2D { - x: self.x / rhs, - y: self.y / rhs, + x: self.x / rhs.into(), + y: self.y / rhs.into(), } } }