Clippy: Use Option::map instead of a manual impl
This commit is contained in:
parent
c5958dbb3d
commit
f2bdebee07
|
|
@ -70,14 +70,8 @@ impl Block {
|
||||||
///
|
///
|
||||||
/// Returns None if this block does not have a block height.
|
/// Returns None if this block does not have a block height.
|
||||||
pub fn root_hash(&self, network: Network) -> Option<RootHash> {
|
pub fn root_hash(&self, network: Network) -> Option<RootHash> {
|
||||||
match self.coinbase_height() {
|
self.coinbase_height()
|
||||||
Some(height) => Some(RootHash::from_bytes(
|
.map(|height| RootHash::from_bytes(self.header.root_bytes, network, height))
|
||||||
self.header.root_bytes,
|
|
||||||
network,
|
|
||||||
height,
|
|
||||||
)),
|
|
||||||
None => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue