use generic_array::{
typenum::{UInt, UTerm, Unsigned, B0, B1},
ArrayLength, GenericArray,
};
use std::fmt::Debug;
use tinyvec::{Array, ArrayVec};
pub trait Length: ArrayLength + Debug + PartialEq {}
impl<N: ArrayLength + Debug + PartialEq> Length for UInt<N, B0> {}
impl<N: ArrayLength + Debug + PartialEq> Length for UInt<N, B1> {}
impl Length for UTerm {}
#[derive(Clone, Debug)]
pub struct GenArr<T, N: ArrayLength>(GenericArray<T, N>);
impl<T: Default, N: ArrayLength> Array for GenArr<T, N> {
type Item = T;
const CAPACITY: usize = <N as Unsigned>::USIZE;
fn as_slice(&self) -> &[Self::Item] {
self.0.as_slice()
}
fn as_slice_mut(&mut self) -> &mut [Self::Item] {
self.0.as_mut_slice()
}
fn default() -> Self {
Self(GenericArray::default())
}
}
pub type ArrVec<T, N> = ArrayVec<GenArr<T, N>>;