mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
Clippy lints for rust 1.66 (#3810)
## Issue Addressed Fixes the new clippy lints for rust 1.66 ## Proposed Changes Most of the changes come from: - [unnecessary_cast](https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast) - [iter_kv_map](https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map) - [needless_borrow](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow) ## Additional Info na
This commit is contained in:
@@ -63,15 +63,15 @@ mod test {
|
||||
#[test]
|
||||
fn encoding() {
|
||||
let bytes = vec![0, 255];
|
||||
let hex = encode(&bytes);
|
||||
let hex = encode(bytes);
|
||||
assert_eq!(hex.as_str(), "0x00ff");
|
||||
|
||||
let bytes = vec![];
|
||||
let hex = encode(&bytes);
|
||||
let hex = encode(bytes);
|
||||
assert_eq!(hex.as_str(), "0x");
|
||||
|
||||
let bytes = vec![1, 2, 3];
|
||||
let hex = encode(&bytes);
|
||||
let hex = encode(bytes);
|
||||
assert_eq!(hex.as_str(), "0x010203");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ impl<'de> Visitor<'de> for QuantityVisitor {
|
||||
} else if stripped.starts_with('0') {
|
||||
Err(de::Error::custom("cannot have leading zero"))
|
||||
} else if stripped.len() % 2 != 0 {
|
||||
hex::decode(&format!("0{}", stripped))
|
||||
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)))
|
||||
|
||||
Reference in New Issue
Block a user