From c1d979b91c662a506927577959674297d43f74cb Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sun, 8 Oct 2017 15:58:14 -0700 Subject: [PATCH] Implement From<(u16,u16)> for Vec2 --- src/vec.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vec.rs b/src/vec.rs index 2c1da31..f08095c 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -162,6 +162,12 @@ impl From<(u8, u8)> for XY { } } +impl From<(u16, u16)> for XY { + fn from((x, y): (u16, u16)) -> Self { + (x as usize, y as usize).into() + } +} + impl, O: Into>> Add for XY { type Output = Self;