refactor: error handling (#41)
This commit is contained in:
@@ -106,14 +106,14 @@ impl<I: StorageIterator> StorageIterator for FusedIterator<I> {
|
||||
}
|
||||
|
||||
fn key(&self) -> Self::KeyType<'_> {
|
||||
if self.has_errored || !self.iter.is_valid() {
|
||||
if !self.is_valid() {
|
||||
panic!("invalid access to the underlying iterator");
|
||||
}
|
||||
self.iter.key()
|
||||
}
|
||||
|
||||
fn value(&self) -> &[u8] {
|
||||
if self.has_errored || !self.iter.is_valid() {
|
||||
if !self.is_valid() {
|
||||
panic!("invalid access to the underlying iterator");
|
||||
}
|
||||
self.iter.value()
|
||||
|
Reference in New Issue
Block a user