Fix clippy lints

This commit is contained in:
Paul Hauner 2018-10-24 15:40:09 +02:00
parent 28ffb037cc
commit b2495cbcff
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C
3 changed files with 5 additions and 4 deletions

View File

@ -21,7 +21,7 @@ impl ChainConfig {
pub fn standard() -> Self { pub fn standard() -> Self {
Self { Self {
cycle_length: 64, cycle_length: 64,
deposit_size_gwei: 32 * 10^9, deposit_size_gwei: 32 * (10^9),
shard_count: 1024, shard_count: 1024,
min_committee_size: 128, min_committee_size: 128,
max_validator_churn_quotient: 32, max_validator_churn_quotient: 32,
@ -36,7 +36,7 @@ impl ChainConfig {
// shard_count / cycle_length > 0 otherwise validator delegation // shard_count / cycle_length > 0 otherwise validator delegation
// will fail. // will fail.
if self.shard_count / self.cycle_length as u16 == 0 { if self.shard_count / u16::from(self.cycle_length) == 0 {
return false; return false;
} }
@ -49,7 +49,7 @@ impl ChainConfig {
pub fn super_fast_tests() -> Self { pub fn super_fast_tests() -> Self {
Self { Self {
cycle_length: 2, cycle_length: 2,
deposit_size_gwei: 32 * 10^9, deposit_size_gwei: 32 * (10^9),
shard_count: 2, shard_count: 2,
min_committee_size: 2, min_committee_size: 2,
max_validator_churn_quotient: 32, max_validator_churn_quotient: 32,

View File

@ -49,7 +49,7 @@ impl SpecialRecord {
/// Match `self.kind` to a `SpecialRecordKind`. /// Match `self.kind` to a `SpecialRecordKind`.
/// ///
/// Returns `None` if `self.kind` is an unknown value. /// Returns `None` if `self.kind` is an unknown value.
fn resolve_kind(&self) -> Option<SpecialRecordKind> { pub fn resolve_kind(&self) -> Option<SpecialRecordKind> {
match self.kind { match self.kind {
x if x == SpecialRecordKind::Logout as u8 x if x == SpecialRecordKind::Logout as u8
=> Some(SpecialRecordKind::Logout), => Some(SpecialRecordKind::Logout),

View File

@ -127,6 +127,7 @@ impl<'a> SszBeaconBlock<'a> {
} }
pub fn len(&self) -> usize { self.ssz.len() } pub fn len(&self) -> usize { self.ssz.len() }
pub fn is_empty(&self) -> bool { self.ssz.is_empty() }
/// Return the canonical hash for this block. /// Return the canonical hash for this block.
pub fn block_hash(&self) -> Vec<u8> { pub fn block_hash(&self) -> Vec<u8> {