Skip to content

Commit

Permalink
Revert "debug trait"
Browse files Browse the repository at this point in the history
This reverts commit c05c0b8.
  • Loading branch information
cmichi committed Nov 26, 2020
1 parent c05c0b8 commit 5cfa303
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion crates/storage/src/collections/smallvec/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const _: () = {

impl<T, const N: usize> SpreadLayout for SmallVec<T, N>
where
T: PackedLayout + Debug,
T: PackedLayout,
{
const FOOTPRINT: u64 = 1 + N as u64;

Expand Down
27 changes: 9 additions & 18 deletions crates/storage/src/lazy/lazy_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,26 +215,17 @@ impl<'a, T> DoubleEndedIterator for EntriesIter<'a, T> {

impl<'a, T> ExactSizeIterator for EntriesIter<'a, T> {}

use std::convert::TryInto;
impl<T: Debug, const N: usize> EntryArray<T, N>
impl<T, const N: usize> EntryArray<T, N>
{
//type Bar = CacheCell<Option<StorageEntry<T>>>;

/// Creates a new entry array cache.
pub fn new() -> Self {
Self {
//entries: [(); N].map(|_|Default::default())
entries: std::iter::repeat_with(|| Default::default())
.take(N)
//.collect::<Vec<CacheCell<Option<StorageEntry<T>>>>>().try_into().unwrap()
.collect::<Vec<CacheCell<Option<StorageEntry<T>>>>>()
//.into()
.try_into().expect("lal")
entries: [(); N].map(|_|Default::default())
}
}
}

impl<T: Debug, const N: usize> Default for EntryArray<T, N>
impl<T, const N: usize> Default for EntryArray<T, N>
{
fn default() -> Self {
Self::new()
Expand Down Expand Up @@ -289,7 +280,7 @@ impl<T, const N: usize> EntryArray<T, N>
}
}

impl<T: Debug, const N: usize> LazyArray<T, N>
impl<T, const N: usize> LazyArray<T, N>
where
T: PackedLayout,
{
Expand Down Expand Up @@ -319,14 +310,14 @@ where
}
}

impl<T: Debug, const N: usize> Default for LazyArray<T, N>
impl<T, const N: usize> Default for LazyArray<T, N>
{
fn default() -> Self {
Self::new()
}
}

impl<T: Debug, const N: usize> LazyArray<T, N>
impl<T, const N: usize> LazyArray<T, N>
{
/// Creates a new empty lazy array.
///
Expand Down Expand Up @@ -389,7 +380,7 @@ impl<T: Debug, const N: usize> LazyArray<T, N>

impl<T, const N: usize> SpreadLayout for LazyArray<T, N>
where
T: PackedLayout + Debug,
T: PackedLayout,
{
const FOOTPRINT: u64 = N as u64;

Expand All @@ -416,7 +407,7 @@ where
}
}

impl<T: Debug, const N: usize> LazyArray<T, N>
impl<T, const N: usize> LazyArray<T, N>
{
/// Returns the offset key for the given index if not out of bounds.
pub fn key_at(&self, at: Index) -> Option<Key> {
Expand All @@ -427,7 +418,7 @@ impl<T: Debug, const N: usize> LazyArray<T, N>
}
}

impl<T: Debug, const N: usize> LazyArray<T, N>
impl<T, const N: usize> LazyArray<T, N>
where
T: PackedLayout,
{
Expand Down

0 comments on commit 5cfa303

Please sign in to comment.