mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 04:57:17 +00:00
Run rustfmt
This commit is contained in:
parent
719dd72de6
commit
39ec96ad82
@ -2,7 +2,7 @@ use crate::*;
|
|||||||
use ssz::{Decode, DecodeError, Encode};
|
use ssz::{Decode, DecodeError, Encode};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use types::beacon_state::{CACHED_EPOCHS, CommitteeCache};
|
use types::beacon_state::{CommitteeCache, CACHED_EPOCHS};
|
||||||
|
|
||||||
/// A container for storing `BeaconState` components.
|
/// A container for storing `BeaconState` components.
|
||||||
#[derive(Encode, Decode)]
|
#[derive(Encode, Decode)]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use ethereum_types::{H256, U128, U256};
|
|
||||||
use core::num::NonZeroUsize;
|
use core::num::NonZeroUsize;
|
||||||
|
use ethereum_types::{H256, U128, U256};
|
||||||
|
|
||||||
macro_rules! impl_decodable_for_uint {
|
macro_rules! impl_decodable_for_uint {
|
||||||
($type: ident, $bit_size: expr) => {
|
($type: ident, $bit_size: expr) => {
|
||||||
@ -76,7 +76,9 @@ impl Decode for NonZeroUsize {
|
|||||||
let x = usize::from_ssz_bytes(bytes)?;
|
let x = usize::from_ssz_bytes(bytes)?;
|
||||||
|
|
||||||
if x == 0 {
|
if x == 0 {
|
||||||
Err(DecodeError::BytesInvalid("NonZeroUsize cannot be zero.".to_string()))
|
Err(DecodeError::BytesInvalid(
|
||||||
|
"NonZeroUsize cannot be zero.".to_string(),
|
||||||
|
))
|
||||||
} else {
|
} else {
|
||||||
// `unwrap` is safe here as `NonZeroUsize::new()` succeeds if `x > 0` and this path
|
// `unwrap` is safe here as `NonZeroUsize::new()` succeeds if `x > 0` and this path
|
||||||
// never executes when `x == 0`.
|
// never executes when `x == 0`.
|
||||||
|
@ -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,
|
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
|
// 23 24 25 26 27
|
||||||
// | 2nd list
|
// | 2nd list
|
||||||
00, 00, 00, 00, 00, 00
|
00, 00, 00, 00, 00, 00,
|
||||||
];
|
];
|
||||||
|
|
||||||
assert_eq!(s.as_ssz_bytes(), bytes);
|
assert_eq!(s.as_ssz_bytes(), bytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user