From 2d9198628c6ed2f53e24833a34cb974548c37d5a Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 28 Sep 2020 21:10:51 -0400 Subject: [PATCH] Use ok_or instead of ok_or_else with unnecessary closure (#1106) https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations --- zebra-consensus/src/block.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zebra-consensus/src/block.rs b/zebra-consensus/src/block.rs index 1a625817..6d1c8c07 100644 --- a/zebra-consensus/src/block.rs +++ b/zebra-consensus/src/block.rs @@ -119,7 +119,7 @@ where // height for parsed blocks when we deserialize them. let height = block .coinbase_height() - .ok_or_else(|| BlockError::MissingHeight(hash))?; + .ok_or(BlockError::MissingHeight(hash))?; if height > block::Height::MAX { Err(BlockError::MaxHeight(height, hash, block::Height::MAX))?; } @@ -130,7 +130,7 @@ where .header .difficulty_threshold .to_expanded() - .ok_or_else(|| BlockError::InvalidDifficulty(height, hash))?; + .ok_or(BlockError::InvalidDifficulty(height, hash))?; if hash > difficulty_threshold { Err(BlockError::DifficultyFilter( height,