From c1423c3768483a49bafd27106c387b596ea0576d Mon Sep 17 00:00:00 2001 From: elizabethengelman <4752801+elizabethengelman@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:04:49 -0500 Subject: [PATCH] Clippy --- cmd/soroban-cli/src/commands/keys/add.rs | 2 +- cmd/soroban-cli/src/signer/secure_store.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/soroban-cli/src/commands/keys/add.rs b/cmd/soroban-cli/src/commands/keys/add.rs index c31d850fc..409409fa1 100644 --- a/cmd/soroban-cli/src/commands/keys/add.rs +++ b/cmd/soroban-cli/src/commands/keys/add.rs @@ -56,7 +56,7 @@ impl Cmd { fn read_secret(&self, print: &Print) -> Result { if let Ok(secret_key) = std::env::var("SOROBAN_SECRET_KEY") { - return Ok(Secret::SecretKey { secret_key }); + Ok(Secret::SecretKey { secret_key }) } else if self.secrets.secure_store { let prompt = "Type a 12 or 24 word seed phrase:"; let secret_key = read_password(print, prompt)?; diff --git a/cmd/soroban-cli/src/signer/secure_store.rs b/cmd/soroban-cli/src/signer/secure_store.rs index 12c7d41fc..e659e7f63 100644 --- a/cmd/soroban-cli/src/signer/secure_store.rs +++ b/cmd/soroban-cli/src/signer/secure_store.rs @@ -48,7 +48,7 @@ pub fn save_secret( write_to_secure_store(entry_name, seed_phrase, print)?; } - return Ok(secret); + Ok(secret) } fn write_to_secure_store( @@ -58,7 +58,7 @@ fn write_to_secure_store( ) -> Result<(), Error> { print.infoln(format!("Writing to secure store: {entry_name}")); let entry = StellarEntry::new(entry_name)?; - Ok(if let Ok(key) = entry.get_public_key(None) { + if let Ok(key) = entry.get_public_key(None) { print.warnln(format!( "A key for {entry_name} already exists in your operating system's secure store: {key}" )); @@ -67,5 +67,6 @@ fn write_to_secure_store( "Saving a new key to your operating system's secure store: {entry_name}" )); entry.set_seed_phrase(seed_phrase)?; - }) + }; + Ok(()) }