mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
add from for tuple
This commit is contained in:
parent
2163a3b490
commit
d6eff37b8a
|
@ -505,6 +505,12 @@ impl<I: FixedWidthUnsignedInteger, const N: usize> Vector2D<Num<I, N>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Number> From<(T, T)> for Vector2D<T> {
|
||||
fn from(f: (T, T)) -> Self {
|
||||
Vector2D::new(f.0, f.1)
|
||||
}
|
||||
}
|
||||
|
||||
impl<I: FixedWidthUnsignedInteger, const N: usize> From<Vector2D<I>> for Vector2D<Num<I, N>> {
|
||||
fn from(n: Vector2D<I>) -> Self {
|
||||
Vector2D {
|
||||
|
|
Loading…
Reference in a new issue