mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Simplify some Option / Result / ? operator patterns (#8653)
* Simplify some Option / Result / ? operator patterns When those match a combinator exactly. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust). * adjust after review * adjust post-review
This commit is contained in:
committed by
GitHub
parent
541692c4a8
commit
052be8bbef
@@ -150,10 +150,8 @@ impl<BlockHash: Hash, Key: Hash> NonCanonicalOverlay<BlockHash, Key> {
|
||||
pub fn new<D: MetaDb>(db: &D) -> Result<NonCanonicalOverlay<BlockHash, Key>, Error<D::Error>> {
|
||||
let last_canonicalized = db.get_meta(&to_meta_key(LAST_CANONICAL, &()))
|
||||
.map_err(|e| Error::Db(e))?;
|
||||
let last_canonicalized = match last_canonicalized {
|
||||
Some(buffer) => Some(<(BlockHash, u64)>::decode(&mut buffer.as_slice())?),
|
||||
None => None,
|
||||
};
|
||||
let last_canonicalized = last_canonicalized
|
||||
.map(|buffer| <(BlockHash, u64)>::decode(&mut buffer.as_slice())).transpose()?;
|
||||
let mut levels = VecDeque::new();
|
||||
let mut parents = HashMap::new();
|
||||
let mut values = HashMap::new();
|
||||
|
||||
Reference in New Issue
Block a user