Rust 1.58 lints (#2906)

## Issue Addressed

Closes #2616

## Proposed Changes

* Fixes for new Rust 1.58.0 lints
* Enable the `fn_to_numeric_cast_any` (#2616)
This commit is contained in:
Michael Sproul 2022-01-13 22:39:58 +00:00
parent 2ce2ec9b62
commit e8887ffea0
4 changed files with 4 additions and 7 deletions

View File

@ -144,6 +144,7 @@ test-full: cargo-fmt test-release test-debug test-ef
# Clippy lints are opt-in per-crate for now. By default, everything is allowed except for performance and correctness lints. # Clippy lints are opt-in per-crate for now. By default, everything is allowed except for performance and correctness lints.
lint: lint:
cargo clippy --workspace --tests -- \ cargo clippy --workspace --tests -- \
-D clippy::fn_to_numeric_cast_any \
-D warnings \ -D warnings \
-A clippy::from-over-into \ -A clippy::from-over-into \
-A clippy::upper-case-acronyms \ -A clippy::upper-case-acronyms \

View File

@ -233,8 +233,7 @@ mod test {
if request_json != expected_json { if request_json != expected_json {
panic!( panic!(
"json mismatch!\n\nobserved: {}\n\nexpected: {}\n\n", "json mismatch!\n\nobserved: {}\n\nexpected: {}\n\n",
request_json.to_string(), request_json, expected_json,
expected_json.to_string()
) )
} }
self self

View File

@ -714,7 +714,7 @@ pub fn set_network_config(
None None
} }
}) { }) {
addr.push_str(&format!(":{}", enr_udp_port.to_string())); addr.push_str(&format!(":{}", enr_udp_port));
} else { } else {
return Err( return Err(
"enr-udp-port must be set for node to be discoverable with dns address" "enr-udp-port must be set for node to be discoverable with dns address"

View File

@ -282,10 +282,7 @@ pub fn load_pem_certificate<P: AsRef<Path>>(pem_path: P) -> Result<Certificate,
} }
fn build_web3_signer_url(base_url: &str, voting_public_key: &PublicKey) -> Result<Url, ParseError> { fn build_web3_signer_url(base_url: &str, voting_public_key: &PublicKey) -> Result<Url, ParseError> {
Url::parse(base_url)?.join(&format!( Url::parse(base_url)?.join(&format!("api/v1/eth2/sign/{}", voting_public_key))
"api/v1/eth2/sign/{}",
voting_public_key.to_string()
))
} }
/// Try to unlock `keystore` at `keystore_path` by prompting the user via `stdin`. /// Try to unlock `keystore` at `keystore_path` by prompting the user via `stdin`.