Fix rust 1.65 lints (#3682)

## Issue Addressed

New lints for rust 1.65

## Proposed Changes

Notable change is the identification or parameters that are only used in recursion

## Additional Info
na
This commit is contained in:
Divma
2022-11-04 07:43:43 +00:00
parent e8604757a2
commit 8600645f65
26 changed files with 37 additions and 77 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ where
S: Serializer,
{
let mut hex_string: String = "0x".to_string();
hex_string.push_str(&hex::encode(&bytes));
hex_string.push_str(&hex::encode(bytes));
serializer.serialize_str(&hex_string)
}
+1 -1
View File
@@ -39,7 +39,7 @@ impl<'de> Visitor<'de> for QuantityVisitor {
hex::decode(&format!("0{}", stripped))
.map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))
} else {
hex::decode(&stripped).map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))
hex::decode(stripped).map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))
}
}
}
+1 -1
View File
@@ -368,7 +368,7 @@ mod test {
fn context_size() {
assert_eq!(
mem::size_of::<HalfNode>(),
232,
224,
"Halfnode size should be as expected"
);
}
+2 -2
View File
@@ -40,7 +40,7 @@ impl ConfigAndPreset {
let extra_fields = get_extra_fields(spec);
if spec.bellatrix_fork_epoch.is_some()
|| fork_name == None
|| fork_name.is_none()
|| fork_name == Some(ForkName::Merge)
{
let bellatrix_preset = BellatrixPreset::from_chain_spec::<T>(spec);
@@ -65,7 +65,7 @@ impl ConfigAndPreset {
/// Get a hashmap of constants to add to the `PresetAndConfig`
pub fn get_extra_fields(spec: &ChainSpec) -> HashMap<String, Value> {
let hex_string = |value: &[u8]| format!("0x{}", hex::encode(&value)).into();
let hex_string = |value: &[u8]| format!("0x{}", hex::encode(value)).into();
let u32_hex = |v: u32| hex_string(&v.to_le_bytes());
let u8_hex = |v: u8| hex_string(&v.to_le_bytes());
hashmap! {
+1 -1
View File
@@ -27,7 +27,7 @@ impl Graffiti {
impl fmt::Display for Graffiti {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", eth2_serde_utils::hex::encode(&self.0))
write!(f, "{}", eth2_serde_utils::hex::encode(self.0))
}
}