diff --git a/lib.rs b/lib.rs index 20209ff..b828d22 100644 --- a/lib.rs +++ b/lib.rs @@ -366,6 +366,13 @@ impl BorrowMut<[A::Item]> for SmallVec { } } +impl<'a, A: Array> From<&'a [A::Item]> for SmallVec where A::Item: Clone { + #[inline] + fn from(slice: &'a [A::Item]) -> SmallVec { + slice.into_iter().cloned().collect() + } +} + macro_rules! impl_index { ($index_type: ty, $output_type: ty) => { impl ops::Index<$index_type> for SmallVec {