From e81a569e3166f00eba5afebd7ab9e2e181a74caf Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Wed, 12 Oct 2016 15:37:35 -0700 Subject: [PATCH] Add From<((left,right), (top, bottom))> to Vec4 --- src/vec.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vec.rs b/src/vec.rs index 2016859..31389e6 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -215,6 +215,18 @@ impl From<(i32, i32, i32, i32)> for Vec4 { } } +impl From<((i32, i32), (i32, i32))> for Vec4 { + fn from(((left, right), (top, bottom)): ((i32, i32), (i32, i32))) -> Vec4 { + (left, right, top, bottom).into() + } +} +impl From<((usize, usize), (usize, usize))> for Vec4 { + fn from(((left, right), (top, bottom)): ((usize, usize), (usize, usize))) + -> Vec4 { + (left, right, top, bottom).into() + } +} + impl> Add for Vec4 { type Output = Vec4;