From 4824b43808960e1cbc3662cdf1df3d9569139a14 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 13 Feb 2019 07:46:59 +1100 Subject: [PATCH] Fix various clippy lints --- eth2/state_processing/src/block_processable.rs | 2 +- eth2/utils/boolean-bitfield/src/lib.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eth2/state_processing/src/block_processable.rs b/eth2/state_processing/src/block_processable.rs index 76c87698a..5f9fe1f7f 100644 --- a/eth2/state_processing/src/block_processable.rs +++ b/eth2/state_processing/src/block_processable.rs @@ -194,7 +194,7 @@ fn per_block_processing_signature_optional( ), Error::BadProposerSlashing ); - state.penalize_validator(proposer_slashing.proposer_index as usize, spec); + state.penalize_validator(proposer_slashing.proposer_index as usize, spec)?; } /* diff --git a/eth2/utils/boolean-bitfield/src/lib.rs b/eth2/utils/boolean-bitfield/src/lib.rs index 16992c3fa..a0fce1f0a 100644 --- a/eth2/utils/boolean-bitfield/src/lib.rs +++ b/eth2/utils/boolean-bitfield/src/lib.rs @@ -81,6 +81,11 @@ impl BooleanBitfield { self.0.len() } + /// Returns true if `self.len() == 0` + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// Returns the number of bytes required to represent this bitfield. pub fn num_bytes(&self) -> usize { self.to_bytes().len()