Implement From<(u16,u16)> for Vec2

This commit is contained in:
Alexandre Bury 2017-10-08 15:58:14 -07:00
parent 7244896263
commit c1d979b91c

View File

@ -162,6 +162,12 @@ impl From<(u8, u8)> for XY<usize> {
}
}
impl From<(u16, u16)> for XY<usize> {
fn from((x, y): (u16, u16)) -> Self {
(x as usize, y as usize).into()
}
}
impl<T: Add<Output = T>, O: Into<XY<T>>> Add<O> for XY<T> {
type Output = Self;