Function array_bytes::vec2array

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

Vec<T> to [T; N].

§Examples

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