Implement From returning a value (instead of a ref only) for matrices and vectors.
This commit is contained in:
parent
847edafcfe
commit
13a5bee25f
|
@ -50,6 +50,14 @@ macro_rules! conversion_impl(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, N: Clone> From<&'a [[N; $dimension]; $dimension]> for $t<N> {
|
||||
#[inline]
|
||||
fn from(arr: &'a [[N; $dimension]; $dimension]) -> $t<N> {
|
||||
let tref: &$t<N> = From::from(arr);
|
||||
tref.clone()
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -51,6 +51,14 @@ macro_rules! conversion_impl(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, N: Clone> From<&'a [N; $dimension]> for $t<N> {
|
||||
#[inline]
|
||||
fn from(arr: &'a [N; $dimension]) -> $t<N> {
|
||||
let vref: &$t<N> = From::from(arr);
|
||||
vref.clone()
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue