From 0da268ad5f9485f002a7a1279ed39d1e503833cb Mon Sep 17 00:00:00 2001 From: Darren Langley Date: Sat, 16 Feb 2019 06:52:10 +1000 Subject: [PATCH] cargo fmt fixes --- eth2/utils/ssz/src/decode.rs | 6 +++--- eth2/utils/ssz/src/encode.rs | 10 +++++----- eth2/utils/ssz/src/impl_encode.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eth2/utils/ssz/src/decode.rs b/eth2/utils/ssz/src/decode.rs index 6053ee940..7b01d6281 100644 --- a/eth2/utils/ssz/src/decode.rs +++ b/eth2/utils/ssz/src/decode.rs @@ -101,7 +101,7 @@ mod tests { let decoded = decode_length(&vec![0, 1, 0, 0], 0, LENGTH_BYTES); assert_eq!(decoded.unwrap(), 256); - let decoded = decode_length(&vec![255, 1, 0, 0], 0, LENGTH_BYTES); + let decoded = decode_length(&vec![255, 1, 0, 0], 0, LENGTH_BYTES); assert_eq!(decoded.unwrap(), 511); let decoded = decode_length(&vec![255, 255, 255, 255], 0, LENGTH_BYTES); @@ -172,8 +172,8 @@ mod tests { let v: Vec = vec![10, 10, 10, 10]; let decoded: (Vec, usize) = decode_ssz_list( &vec![ - 32, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, - 0, 10, 0, 0, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, ], 0, ) diff --git a/eth2/utils/ssz/src/encode.rs b/eth2/utils/ssz/src/encode.rs index f310c8d1b..3de83c730 100644 --- a/eth2/utils/ssz/src/encode.rs +++ b/eth2/utils/ssz/src/encode.rs @@ -131,14 +131,14 @@ mod tests { assert_eq!(ssz.len(), LENGTH_BYTES + (12 * 2)); assert_eq!(ssz[0..4], *vec![24, 0, 0, 0]); - assert_eq!(ssz[4..6], *vec![0, 1]); + assert_eq!(ssz[4..6], *vec![0, 1]); } #[test] fn test_encode_mixed_prefixed() { let test_vec: Vec = vec![100, 200]; let test_value: u8 = 5; - + let mut stream = SszStream::new(); stream.append_vec(&test_vec); stream.append(&test_value); @@ -151,11 +151,11 @@ mod tests { assert_eq!(ssz[8], 5); } - #[test] + #[test] fn test_encode_mixed_postfixed() { let test_value: u8 = 5; - let test_vec: Vec = vec![100, 200]; - + let test_vec: Vec = vec![100, 200]; + let mut stream = SszStream::new(); stream.append(&test_value); stream.append_vec(&test_vec); diff --git a/eth2/utils/ssz/src/impl_encode.rs b/eth2/utils/ssz/src/impl_encode.rs index c41799d92..0bb91366d 100644 --- a/eth2/utils/ssz/src/impl_encode.rs +++ b/eth2/utils/ssz/src/impl_encode.rs @@ -221,7 +221,7 @@ mod tests { stream.append(&b); stream.append(&c); - let ssz = stream.drain(); + let ssz = stream.drain(); assert_eq!(ssz[0..20], *vec![0; 20]); assert_eq!(ssz[20], 100); assert_eq!(ssz[21..23], *vec![255, 255]);