From 39ec96ad82f28e1a70b074b32d5fdc7bbcf11b85 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 7 Jun 2019 02:55:43 -0400 Subject: [PATCH] Run rustfmt --- beacon_node/store/src/impls/beacon_state.rs | 2 +- eth2/utils/ssz/src/decode/impls.rs | 6 ++++-- eth2/utils/ssz/tests/tests.rs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/beacon_node/store/src/impls/beacon_state.rs b/beacon_node/store/src/impls/beacon_state.rs index 40d2cacb8..591663fe0 100644 --- a/beacon_node/store/src/impls/beacon_state.rs +++ b/beacon_node/store/src/impls/beacon_state.rs @@ -2,7 +2,7 @@ use crate::*; use ssz::{Decode, DecodeError, Encode}; use ssz_derive::{Decode, Encode}; use std::convert::TryInto; -use types::beacon_state::{CACHED_EPOCHS, CommitteeCache}; +use types::beacon_state::{CommitteeCache, CACHED_EPOCHS}; /// A container for storing `BeaconState` components. #[derive(Encode, Decode)] diff --git a/eth2/utils/ssz/src/decode/impls.rs b/eth2/utils/ssz/src/decode/impls.rs index 7dd7fac3c..0965ee3e5 100644 --- a/eth2/utils/ssz/src/decode/impls.rs +++ b/eth2/utils/ssz/src/decode/impls.rs @@ -1,6 +1,6 @@ use super::*; -use ethereum_types::{H256, U128, U256}; use core::num::NonZeroUsize; +use ethereum_types::{H256, U128, U256}; macro_rules! impl_decodable_for_uint { ($type: ident, $bit_size: expr) => { @@ -76,7 +76,9 @@ impl Decode for NonZeroUsize { let x = usize::from_ssz_bytes(bytes)?; if x == 0 { - Err(DecodeError::BytesInvalid("NonZeroUsize cannot be zero.".to_string())) + Err(DecodeError::BytesInvalid( + "NonZeroUsize cannot be zero.".to_string(), + )) } else { // `unwrap` is safe here as `NonZeroUsize::new()` succeeds if `x > 0` and this path // never executes when `x == 0`. diff --git a/eth2/utils/ssz/tests/tests.rs b/eth2/utils/ssz/tests/tests.rs index 06c689817..9447cf537 100644 --- a/eth2/utils/ssz/tests/tests.rs +++ b/eth2/utils/ssz/tests/tests.rs @@ -309,7 +309,7 @@ mod round_trip { 42, 00, 14, 00, 00, 00, 18, 00, 00, 00, 24, 00, 00, 00, 00, 00, 00, 00, 01, 00, 00, 00, // 23 24 25 26 27 // | 2nd list - 00, 00, 00, 00, 00, 00 + 00, 00, 00, 00, 00, 00, ]; assert_eq!(s.as_ssz_bytes(), bytes);