mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
Clippy clean (#536)
* Change into_iter to iter * Fix clippy 'easy' warnings * Clippy eth2/utils * Add struct NetworkInfo * Clippy for types, utils, and beacon_node/store/src/iters.rs * Cargo fmt * Change foo to my_foo * Remove complex signature * suppress clippy warning for unit_value in benches * Use enumerate instead of iterating over range * Allow trivially_copy_pass_by_ref in serde_utils
This commit is contained in:
@@ -222,15 +222,12 @@ fn ssz_generic_test<T: SszStaticType>(path: &Path) -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
// Invalid
|
||||
else {
|
||||
if let Ok(decoded) = T::from_ssz_bytes(&serialized) {
|
||||
return Err(Error::DidntFail(format!(
|
||||
"Decoded invalid bytes into: {:?}",
|
||||
decoded
|
||||
)));
|
||||
}
|
||||
else if let Ok(decoded) = T::from_ssz_bytes(&serialized) {
|
||||
return Err(Error::DidntFail(format!(
|
||||
"Decoded invalid bytes into: {:?}",
|
||||
decoded
|
||||
)));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -291,11 +288,11 @@ where
|
||||
let decoded: Vec<u8> = hex::decode(&s.as_str()[2..]).map_err(D::Error::custom)?;
|
||||
|
||||
if decoded.len() > N::to_usize() {
|
||||
return Err(D::Error::custom(format!(
|
||||
Err(D::Error::custom(format!(
|
||||
"Too many values for list, got: {}, limit: {}",
|
||||
decoded.len(),
|
||||
N::to_usize()
|
||||
)));
|
||||
)))
|
||||
} else {
|
||||
Ok(decoded.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user