From f2bdebee07630922b47e4d689a133334995bf6f2 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 2 Mar 2021 12:50:22 +1000 Subject: [PATCH] Clippy: Use Option::map instead of a manual impl --- zebra-chain/src/block.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/zebra-chain/src/block.rs b/zebra-chain/src/block.rs index 0975cbe9..6f741832 100644 --- a/zebra-chain/src/block.rs +++ b/zebra-chain/src/block.rs @@ -70,14 +70,8 @@ impl Block { /// /// Returns None if this block does not have a block height. pub fn root_hash(&self, network: Network) -> Option { - match self.coinbase_height() { - Some(height) => Some(RootHash::from_bytes( - self.header.root_bytes, - network, - height, - )), - None => None, - } + self.coinbase_height() + .map(|height| RootHash::from_bytes(self.header.root_bytes, network, height)) } }