Skip to main content

libutils_array/
conversions.rs

1//^
2//^ HEAD
3//^
4
5//> HEAD -> SUPER
6use super::Array;
7
8//> HEAD -> ALLOC
9use alloc::vec::Vec;
10
11
12//^
13//^ CONVERSIONS
14//^
15
16//> CONVERSIONS -> FROM FIXED TO VARIABLE
17impl<Type, const M: usize, const N: usize> From<[Type; N]> for Array<Type, M> {
18    fn from(value: [Type; N]) -> Self {return Array::from_iter(value)}
19}
20
21//> CONVERSIONS -> VEC
22impl<Type, const N: usize> Into<Vec<Type>> for Array<Type, N> {
23    fn into(self) -> Vec<Type> {return Vec::from_iter(self.into_iter())}
24}