Function array_bytes::vec2array

source ·
pub fn vec2array<const N: usize, T>(vec: Vec<T>) -> ArrayBytesResult<[T; N]>
Expand description

Vec<T> to [T; M].

Examples

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