From a8597d7145eb0d844b6115177df55bcf9d9a41f6 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Sun, 21 Apr 2024 22:51:11 +0530 Subject: [PATCH] fix: more clippy lints --- bin/sozo/src/commands/options/signer.rs | 10 +++------- crates/sozo/ops/src/account.rs | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/sozo/src/commands/options/signer.rs b/bin/sozo/src/commands/options/signer.rs index 9a9a14e128..320ef0a8c3 100644 --- a/bin/sozo/src/commands/options/signer.rs +++ b/bin/sozo/src/commands/options/signer.rs @@ -57,14 +57,10 @@ impl SignerOptions { .or_else(|| env_metadata.and_then(|env| env.keystore_password())) { password.to_owned() + } else if no_wait { + return Err(anyhow!("Could not find password. Please specify the password.")); } else { - if no_wait { - return Err(anyhow!( - "Could not find password. Please specify the password." - )); - } else { - rpassword::prompt_password("Enter password: ")? - } + rpassword::prompt_password("Enter password: ")? } }; let private_key = SigningKey::from_keystore(path, &password)?; diff --git a/crates/sozo/ops/src/account.rs b/crates/sozo/ops/src/account.rs index 4460227f35..ce1ebcce0d 100644 --- a/crates/sozo/ops/src/account.rs +++ b/crates/sozo/ops/src/account.rs @@ -185,6 +185,7 @@ pub async fn new(signer: LocalWallet, force: bool, file: PathBuf) -> Result<()> Ok(()) } +#[allow(clippy::too_many_arguments)] pub async fn deploy( provider: JsonRpcClient, signer: LocalWallet, @@ -284,7 +285,7 @@ pub async fn deploy( if simulate { simulate_account_deploy(&account_deployment).await?; - return Ok(()); + Ok(()) } else { do_account_deploy( max_fee, @@ -398,7 +399,7 @@ async fn simulate_account_deploy( colored_json::to_colored_json(&simulation_json, ColorMode::Auto(Output::StdOut))?; println!("{simulation_json}"); - return Ok(()); + Ok(()) } pub async fn fetch(