diff --git a/src/structs/matrix_macros.rs b/src/structs/matrix_macros.rs index 6bbd0aa8..3c401c6b 100644 --- a/src/structs/matrix_macros.rs +++ b/src/structs/matrix_macros.rs @@ -50,6 +50,14 @@ macro_rules! conversion_impl( } } } + + impl<'a, N: Clone> From<&'a [[N; $dimension]; $dimension]> for $t { + #[inline] + fn from(arr: &'a [[N; $dimension]; $dimension]) -> $t { + let tref: &$t = From::from(arr); + tref.clone() + } + } ) ); diff --git a/src/structs/vector_macros.rs b/src/structs/vector_macros.rs index 99c6e980..6f52b342 100644 --- a/src/structs/vector_macros.rs +++ b/src/structs/vector_macros.rs @@ -51,6 +51,14 @@ macro_rules! conversion_impl( } } } + + impl<'a, N: Clone> From<&'a [N; $dimension]> for $t { + #[inline] + fn from(arr: &'a [N; $dimension]) -> $t { + let vref: &$t = From::from(arr); + vref.clone() + } + } ) );