From 70944500fcaa718a73eec183dd57025019c2edb4 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Sun, 18 May 2025 09:05:44 +0100 Subject: [PATCH] chore: clippy mint_url (#759) --- crates/cashu/src/mint_url.rs | 6 +++--- crates/cdk-cli/src/sub_commands/create_request.rs | 13 +++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/crates/cashu/src/mint_url.rs b/crates/cashu/src/mint_url.rs index 0964b94d..c2149fd5 100644 --- a/crates/cashu/src/mint_url.rs +++ b/crates/cashu/src/mint_url.rs @@ -77,7 +77,7 @@ impl MintUrl { .join("/"); let mut formatted_url = format!("{protocol}://{host}"); if !path.is_empty() { - formatted_url.push_str(&format!("/{}", path)); + formatted_url.push_str(&format!("/{path}")); } Ok(formatted_url) } @@ -91,9 +91,9 @@ impl MintUrl { // Check if the path has a trailing slash to avoid double slashes let normalized_path = if base_path.ends_with('/') { - format!("{}{}", base_path, path) + format!("{base_path}{path}") } else { - format!("{}/{}", base_path, path) + format!("{base_path}/{path}") }; // Create a new URL with the combined path diff --git a/crates/cdk-cli/src/sub_commands/create_request.rs b/crates/cdk-cli/src/sub_commands/create_request.rs index 3a6e0fdf..0b608a47 100644 --- a/crates/cdk-cli/src/sub_commands/create_request.rs +++ b/crates/cdk-cli/src/sub_commands/create_request.rs @@ -72,7 +72,7 @@ pub async fn create_request( // Use custom relays if provided, otherwise use defaults let relays = if let Some(custom_relays) = &sub_command_args.nostr_relay { if !custom_relays.is_empty() { - println!("Using custom Nostr relays: {:?}", custom_relays); + println!("Using custom Nostr relays: {custom_relays:?}"); custom_relays.clone() } else { // Empty vector provided, fall back to defaults @@ -120,10 +120,7 @@ pub async fn create_request( } "none" => (None, None), _ => { - println!( - "Warning: Unknown transport type '{}', defaulting to none", - transport_type - ); + println!("Warning: Unknown transport type '{transport_type}', defaulting to none"); (None, None) } }; @@ -142,7 +139,7 @@ pub async fn create_request( match PublicKey::from_str(pubkey_str) { Ok(pubkey) => parsed_pubkeys.push(pubkey), Err(err) => { - println!("Error parsing pubkey {}: {}", pubkey_str, err); + println!("Error parsing pubkey {pubkey_str}: {err}"); // Continue with other pubkeys } } @@ -176,7 +173,7 @@ pub async fn create_request( }) } Err(err) => { - println!("Error parsing hash: {}", err); + println!("Error parsing hash: {err}"); // Fallback to just P2PK with multiple pubkeys bail!("Error parsing hash"); } @@ -218,7 +215,7 @@ pub async fn create_request( conditions: None, }), Err(err) => { - println!("Error parsing hash: {}", err); + println!("Error parsing hash: {err}"); None } }