mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
Simplify some Option / Result / ? operator patterns (#2920)
* Simplify some Option / Result / ? operator patterns When they identically match a combinator on those types. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust). * adjust review comments Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c7ee98ab5f
commit
d4ddf8d7e8
@@ -317,10 +317,7 @@ pub fn tranches_to_approve(
|
||||
tranches_with_gaps_filled
|
||||
.scan(Some(initial_state), |state, (tranche, assignments)| {
|
||||
// The `Option` here is used for early exit.
|
||||
let s = match state.take() {
|
||||
None => return None,
|
||||
Some(s) => s,
|
||||
};
|
||||
let s = state.take()?;
|
||||
|
||||
let clock_drift = s.clock_drift(no_show_duration);
|
||||
let drifted_tick_now = tick_now.saturating_sub(clock_drift);
|
||||
|
||||
Reference in New Issue
Block a user