Skip to content

Commit

Permalink
More merkle.rs cleanup (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpringle authored Oct 26, 2023
1 parent 2680695 commit 1ed24f3
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 167 deletions.
6 changes: 2 additions & 4 deletions firewood/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use std::{
io::{Cursor, ErrorKind, Write},
mem::size_of,
num::NonZeroUsize,
ops::Deref,
os::fd::{AsFd, BorrowedFd},
path::Path,
sync::Arc,
Expand Down Expand Up @@ -287,10 +288,7 @@ impl<S: ShaleStore<Node> + Send + Sync> api::DbView for DbRev<S> {
let obj_ref = self.merkle.get(key, self.header.kv_root);
match obj_ref {
Err(e) => Err(api::Error::IO(std::io::Error::new(ErrorKind::Other, e))),
Ok(obj) => match obj {
None => Ok(None),
Some(inner) => Ok(Some(inner.as_ref().to_owned())),
},
Ok(obj) => Ok(obj.map(|inner| inner.deref().to_owned())),
}
}

Expand Down
Loading

0 comments on commit 1ed24f3

Please sign in to comment.