Fix various clippy lints

This commit is contained in:
Paul Hauner 2019-02-13 07:46:59 +11:00
parent 05ed778ccc
commit 4824b43808
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
2 changed files with 6 additions and 1 deletions

View File

@ -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)?;
}
/*

View File

@ -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()