mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +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
@@ -104,10 +104,7 @@ pub async fn seal_block<B, BI, SC, C, E, P>(
|
||||
// or fetch the best_block.
|
||||
let parent = match parent_hash {
|
||||
Some(hash) => {
|
||||
match client.header(BlockId::Hash(hash))? {
|
||||
Some(header) => header,
|
||||
None => return Err(Error::BlockNotFound(format!("{}", hash))),
|
||||
}
|
||||
client.header(BlockId::Hash(hash))?.ok_or_else(|| Error::BlockNotFound(format!("{}", hash)))?
|
||||
}
|
||||
None => select_chain.best_chain()?
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user