Skip to content

Commit

Permalink
Use let .. else statement
Browse files Browse the repository at this point in the history
Co-authored-by: Arya <[email protected]>
  • Loading branch information
upbqdn and arya2 authored Mar 16, 2023
1 parent f97b104 commit e6dbc73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zebra-consensus/src/block/subsidy/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ pub fn halving_divisor(height: Height, network: Network) -> Option<u64> {
.activation_height(network)
.expect("blossom activation height should be available");

let slow_start_shift_diff = height - SLOW_START_SHIFT;
let slow_start_shift_diff = slow_start_shift_diff.unwrap_or_else(|| {
let Some(slow_start_shift_diff) = height - SLOW_START_SHIFT else {
unreachable!(
"unsupported block height: checkpoints should handle blocks below {:?}",
SLOW_START_SHIFT
Expand Down

0 comments on commit e6dbc73

Please sign in to comment.