From 3bee54620bb7c23b18976bbaeb7c1dd3732cb318 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 2 Jul 2024 18:16:57 +0200 Subject: [PATCH 1/3] clippy fix --- src/commands/monitor.rs | 2 +- src/epm.rs | 2 +- tests/common.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/monitor.rs b/src/commands/monitor.rs index f9e416313..7de269beb 100644 --- a/src/commands/monitor.rs +++ b/src/commands/monitor.rs @@ -323,7 +323,7 @@ where let _lock = submit_lock.lock().await; let (solution, score) = match epm::fetch_snapshot_and_mine_solution::( - &client.chain_api(), + client.chain_api(), Some(block_hash), config.solver, round, diff --git a/src/epm.rs b/src/epm.rs index 0ec3846f5..6cf56149d 100644 --- a/src/epm.rs +++ b/src/epm.rs @@ -149,7 +149,7 @@ where targets.remove(&rm); } - return Err(Error::Feasibility("Failed to pre-trim weight < T::MaxLength".to_string())); + Err(Error::Feasibility("Failed to pre-trim weight < T::MaxLength".to_string())) } /// Clone the state and trim it, so it get can be reverted. diff --git a/tests/common.rs b/tests/common.rs index 406b449e7..f65ee1148 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -94,7 +94,7 @@ pub fn run_polkadot_node(chain: Chain) -> (KillChildOnDrop, String) { .stderr(process::Stdio::piped()) .args([ "--chain", - &chain_str, + chain_str, "--tmp", "--alice", "--unsafe-force-node-key-generation", From bcd21829d9e18808a888bfc503212a7ba834fc2f Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 2 Jul 2024 21:26:21 +0200 Subject: [PATCH 2/3] fix more clippy --- src/error.rs | 4 ++-- src/helpers.rs | 6 +++--- tests/common.rs | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/error.rs b/src/error.rs index cedcd8c3c..0eac334b3 100644 --- a/src/error.rs +++ b/src/error.rs @@ -23,7 +23,7 @@ pub enum Error { #[error("I/O error: `{0}`")] Io(#[from] std::io::Error), #[error("RPC error: `{0}`")] - RpcError(#[from] jsonrpsee::core::ClientError), + Rpc(#[from] jsonrpsee::core::ClientError), #[error("subxt error: `{0}`")] Subxt(#[from] subxt::Error), #[error("Crypto error: `{0:?}`")] @@ -51,7 +51,7 @@ pub enum Error { #[error("Feasibility error: {0}")] Feasibility(String), #[error("{0}")] - JoinError(#[from] tokio::task::JoinError), + Join(#[from] tokio::task::JoinError), #[error("Empty snapshot")] EmptySnapshot, } diff --git a/src/helpers.rs b/src/helpers.rs index 253aab455..441702588 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -86,7 +86,7 @@ pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender {}, Error::Subxt(SubxtError::Rpc(rpc_err)) => { @@ -115,8 +115,8 @@ pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender Date: Tue, 2 Jul 2024 21:30:31 +0200 Subject: [PATCH 3/3] cargo fmt --- src/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 441702588..fc2a5a143 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -115,8 +115,8 @@ pub fn kill_main_task_if_critical_err(tx: &tokio::sync::mpsc::UnboundedSender