From 481718856cbbd4229562192d87a436b4a2ba5d2e Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 26 Jan 2023 22:28:49 +0100 Subject: [PATCH] Fix clippy --- consensus/ssz/src/decode/impls.rs | 7 +++---- consensus/tree_hash/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/consensus/ssz/src/decode/impls.rs b/consensus/ssz/src/decode/impls.rs index 3d36fb437..f58ecd3b8 100644 --- a/consensus/ssz/src/decode/impls.rs +++ b/consensus/ssz/src/decode/impls.rs @@ -479,7 +479,7 @@ pub fn decode_list_of_variable_length_items ) -> Result { if bytes.is_empty() { return Container::try_from_iter(iter::empty()).map_err(|e| { - DecodeError::BytesInvalid(format!("Error trying to collect empty list: {:?}", e)) + DecodeError::BytesInvalid(format!("Error trying to collect empty list: {e:?}")) }); } @@ -494,8 +494,7 @@ pub fn decode_list_of_variable_length_items if max_len.map_or(false, |max| num_items > max) { return Err(DecodeError::BytesInvalid(format!( - "Variable length list of {} items exceeds maximum of {:?}", - num_items, max_len + "Variable length list of {num_items} items exceeds maximum of {max_len:?}", ))); } @@ -519,7 +518,7 @@ pub fn decode_list_of_variable_length_items }), |iter| iter.try_collect(), )? - .map_err(|e| DecodeError::BytesInvalid(format!("Error collecting into container: {:?}", e))) + .map_err(|e| DecodeError::BytesInvalid(format!("Error collecting into container: {e:?}"))) } #[cfg(test)] diff --git a/consensus/tree_hash/src/lib.rs b/consensus/tree_hash/src/lib.rs index ec40de916..d9ab4bd70 100644 --- a/consensus/tree_hash/src/lib.rs +++ b/consensus/tree_hash/src/lib.rs @@ -97,7 +97,7 @@ fn get_zero_hash(height: usize) -> &'static [u8] { if height <= ZERO_HASHES_MAX_INDEX { &ZERO_HASHES[height] } else { - panic!("Tree exceeds MAX_TREE_DEPTH of {}", ZERO_HASHES_MAX_INDEX) + panic!("Tree exceeds MAX_TREE_DEPTH of {ZERO_HASHES_MAX_INDEX}") } }