diff --git a/crates/storage/src/collections/smallvec/storage.rs b/crates/storage/src/collections/smallvec/storage.rs index 94817253e76..16b6f280cb6 100644 --- a/crates/storage/src/collections/smallvec/storage.rs +++ b/crates/storage/src/collections/smallvec/storage.rs @@ -52,7 +52,7 @@ const _: () = { impl SpreadLayout for SmallVec where - T: PackedLayout, + T: PackedLayout + Debug, { const FOOTPRINT: u64 = 1 + N as u64; diff --git a/crates/storage/src/lazy/lazy_array.rs b/crates/storage/src/lazy/lazy_array.rs index 3464300dfa5..c96b58763ad 100644 --- a/crates/storage/src/lazy/lazy_array.rs +++ b/crates/storage/src/lazy/lazy_array.rs @@ -215,17 +215,26 @@ impl<'a, T> DoubleEndedIterator for EntriesIter<'a, T> { impl<'a, T> ExactSizeIterator for EntriesIter<'a, T> {} -impl EntryArray +use std::convert::TryInto; +impl EntryArray { + //type Bar = CacheCell>>; + /// Creates a new entry array cache. pub fn new() -> Self { Self { - entries: [(); N].map(|_|Default::default()) + //entries: [(); N].map(|_|Default::default()) + entries: std::iter::repeat_with(|| Default::default()) + .take(N) + //.collect::>>>>().try_into().unwrap() + .collect::>>>>() + //.into() + .try_into().expect("lal") } } } -impl Default for EntryArray +impl Default for EntryArray { fn default() -> Self { Self::new() @@ -280,7 +289,7 @@ impl EntryArray } } -impl LazyArray +impl LazyArray where T: PackedLayout, { @@ -310,14 +319,14 @@ where } } -impl Default for LazyArray +impl Default for LazyArray { fn default() -> Self { Self::new() } } -impl LazyArray +impl LazyArray { /// Creates a new empty lazy array. /// @@ -380,7 +389,7 @@ impl LazyArray impl SpreadLayout for LazyArray where - T: PackedLayout, + T: PackedLayout + Debug, { const FOOTPRINT: u64 = N as u64; @@ -407,7 +416,7 @@ where } } -impl LazyArray +impl LazyArray { /// Returns the offset key for the given index if not out of bounds. pub fn key_at(&self, at: Index) -> Option { @@ -418,7 +427,7 @@ impl LazyArray } } -impl LazyArray +impl LazyArray where T: PackedLayout, {