diff --git a/src/traits.rs b/src/traits.rs index 4ebe27d..18a80d0 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -59,3 +59,10 @@ impl<'a,T> Strided for MutStride<'a,T> { impl<'a,T> MutStrided for MutStride<'a,T> { fn as_stride_mut(&mut self) -> MutStride { self.reborrow() } } + +impl<'a,T, X: AsRef<[T]> + ?Sized> From<&'a X> for Stride<'a,T> { + fn from(value: &X) -> Stride { Stride::new(value.as_ref()) } +} +impl<'a,T, X: AsMut<[T]> + ?Sized> From<&'a mut X> for MutStride<'a,T> { + fn from(value: &mut X) -> MutStride { MutStride::new(value.as_mut()) } +}