Function array_bytes::slice2array

source ·
pub fn slice2array<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]));