Add progress on state_processing fixed-len update

This commit is contained in:
Paul Hauner
2019-05-08 15:36:02 +10:00
parent 7a67d34293
commit 8cefd20e9d
29 changed files with 275 additions and 268 deletions

View File

@@ -17,6 +17,16 @@ where
_phantom: PhantomData<N>,
}
impl<T, N: Unsigned> FixedLenVec<T, N> {
pub fn len(&self) -> usize {
self.vec.len()
}
pub fn capacity() -> usize {
N::to_usize()
}
}
impl<T: Default, N: Unsigned> From<Vec<T>> for FixedLenVec<T, N> {
fn from(mut vec: Vec<T>) -> Self {
dbg!(Self::capacity());
@@ -44,12 +54,6 @@ impl<T, N: Unsigned> Default for FixedLenVec<T, N> {
}
}
impl<T, N: Unsigned> FixedLenVec<T, N> {
pub fn capacity() -> usize {
N::to_usize()
}
}
impl<T, N: Unsigned, I: SliceIndex<[T]>> Index<I> for FixedLenVec<T, N> {
type Output = I::Output;