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:
François Garillot authored and GitHub committed 2021-04-23 13:36:10 +00:00
1 parent 541692c4a8
commit 052be8bbef
37 files changed
+77 -188

No files matched your search

+1 -4
View File
@@ -256,10 +256,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
return None;
}
let claim = match self.claim_slot(&chain_head, slot, &epoch_data) {
None => return None,
Some(claim) => claim,
};
let claim = self.claim_slot(&chain_head, slot, &epoch_data)?;
if self.should_backoff(slot, &chain_head) {
return None;