From b1253fa61d6fe58c33b5b4fe6cd1b483e6bda2f3 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 13 Jan 2022 17:05:51 +1100 Subject: [PATCH 1/2] Update Rust 1.58.0 lints --- beacon_node/execution_layer/src/engine_api/http.rs | 3 +-- beacon_node/src/config.rs | 2 +- validator_client/src/initialized_validators.rs | 5 +---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index 96a50ee2e01..c7c60a90062 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -233,8 +233,7 @@ mod test { if request_json != expected_json { panic!( "json mismatch!\n\nobserved: {}\n\nexpected: {}\n\n", - request_json.to_string(), - expected_json.to_string() + request_json, expected_json, ) } self diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index ce2f65e70b4..f65e6471fdc 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -714,7 +714,7 @@ pub fn set_network_config( None } }) { - addr.push_str(&format!(":{}", enr_udp_port.to_string())); + addr.push_str(&format!(":{}", enr_udp_port)); } else { return Err( "enr-udp-port must be set for node to be discoverable with dns address" diff --git a/validator_client/src/initialized_validators.rs b/validator_client/src/initialized_validators.rs index 57585e2672f..72e651f7d18 100644 --- a/validator_client/src/initialized_validators.rs +++ b/validator_client/src/initialized_validators.rs @@ -282,10 +282,7 @@ pub fn load_pem_certificate>(pem_path: P) -> Result Result { - Url::parse(base_url)?.join(&format!( - "api/v1/eth2/sign/{}", - voting_public_key.to_string() - )) + Url::parse(base_url)?.join(&format!("api/v1/eth2/sign/{}", voting_public_key)) } /// Try to unlock `keystore` at `keystore_path` by prompting the user via `stdin`. From 075b9b9d244605161d0899ef3fae22196cb9cb2e Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 13 Jan 2022 17:06:04 +1100 Subject: [PATCH 2/2] Disallow `fn_to_numeric_cast_any` --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 494f325d269..a4b880b8065 100644 --- a/Makefile +++ b/Makefile @@ -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. lint: cargo clippy --workspace --tests -- \ + -D clippy::fn_to_numeric_cast_any \ -D warnings \ -A clippy::from-over-into \ -A clippy::upper-case-acronyms \