Function array_bytes::slice2array_ref

source ·
pub fn slice2array_ref<T, const N: usize>(slice: &[T]) -> Result<&[T; N]>
where T: Copy,
Expand description

&[T] to &[T; N].

§Examples

assert_eq!(array_bytes::slice2array::<_, 8>(&[0; 8]), Ok(&[0; 8]));