Browse Source

chore: clippy mint_url (#759)

thesimplekid 1 tháng trước cách đây
mục cha
commit
70944500fc

+ 3 - 3
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

+ 5 - 8
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
             }
         }