@ -43,6 +43,13 @@ macro_rules! utf8_to_utf16_array {
}
pub fn vec_to_array<T: Default + Copy, const N: usize>(vec: Vec<T>) -> [T; N] {
let mut result: [T; N] = [T::default(); N];
for (i, v) in vec.into_iter().enumerate() {
result[i] = v
result
#[cfg(test)]
mod test {