Skip to content

Commit

Permalink
Hmm
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-D-coder committed Mar 20, 2024
1 parent bf53774 commit aca044d
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 142 deletions.
17 changes: 17 additions & 0 deletions src/stored.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ impl<V, S: Store<V>> Store<V> for &S {
}
}

/// A `Store` that always panics when accessed.
pub(crate) struct UnreachableStore;

impl<V> Store<V> for UnreachableStore {
type Error = core::convert::Infallible;

#[inline(always)]
fn calc_subtree_hash(&self, _hash_idx: Idx) -> Result<NodeHash, Self::Error> {
unreachable!("UnreachableStore")
}

#[inline(always)]
fn get_node(&self, _hash_idx: Idx) -> Result<Node<&Branch<Idx>, &Leaf<V>>, Self::Error> {
unreachable!("UnreachableStore")
}
}

pub trait DatabaseGet<V> {
type GetError: Display;

Expand Down
Loading

0 comments on commit aca044d

Please sign in to comment.