Rust Vec для массива

///	It requires that the type `T` implement the `Copy``trait.
fn demo<T>(v: Vec<T>) -> [T; 32] where T: Copy {
    let slice = v.as_slice();
    let array: [T; 32] = match slice.try_into() {
        Ok(ba) => ba,
        Err(_) => panic!("Expected a Vec of length {} but it was {}", 32, v.len()),
    };
    array
}
SnefDen