chore: clippy mint_url (#759)

This commit is contained in:
thesimplekid
2025-05-18 09:05:44 +01:00
committed by GitHub
parent c001375b32
commit 70944500fc
2 changed files with 8 additions and 11 deletions

View File

@@ -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

View File

@@ -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
}
}