From b08e8d24be9dafe9bd8677b1789a5b0cca7db43d Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Fri, 11 Jun 2021 20:38:06 +0100 Subject: [PATCH] from tuple accepts anything that is convertable --- agb/src/number.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agb/src/number.rs b/agb/src/number.rs index de0885dd..91aece71 100644 --- a/agb/src/number.rs +++ b/agb/src/number.rs @@ -528,15 +528,15 @@ impl Vector2D> { } } -impl From<(T, T)> for Vector2D { - fn from(f: (T, T)) -> Self { - Vector2D::new(f.0, f.1) +impl> From<(P, P)> for Vector2D { + fn from(f: (P, P)) -> Self { + Vector2D::new(f.0.into(), f.1.into()) } } impl Vector2D { pub fn change_base>(self) -> Vector2D { - (self.x.into(), self.y.into()).into() + (self.x, self.y).into() } }