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
This commit is contained in:
parent
2230e353df
commit
2d9198628c
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue