From d6eff37b8a1df0288aefbfc7a10edc8acc28453e Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Tue, 8 Jun 2021 12:31:27 +0100 Subject: [PATCH] add from for tuple --- agb/src/number.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agb/src/number.rs b/agb/src/number.rs index 86581a25..a30f93ca 100644 --- a/agb/src/number.rs +++ b/agb/src/number.rs @@ -505,6 +505,12 @@ impl Vector2D> { } } +impl From<(T, T)> for Vector2D { + fn from(f: (T, T)) -> Self { + Vector2D::new(f.0, f.1) + } +} + impl From> for Vector2D> { fn from(n: Vector2D) -> Self { Vector2D {