Function array_bytes::slice2array

source ·
pub fn slice2array<const N: usize, T>(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]));