Parcourir la source

chore: clippy (#750)

* chore: clippy

* chore: fmt
thesimplekid il y a 1 mois
Parent
commit
e268866446
38 fichiers modifiés avec 65 ajouts et 82 suppressions
  1. 2 2
      crates/cashu/src/mint_url.rs
  2. 1 1
      crates/cashu/src/nuts/auth/nut21.rs
  3. 1 1
      crates/cashu/src/nuts/auth/nut22.rs
  4. 1 1
      crates/cashu/src/nuts/nut00/mod.rs
  5. 3 3
      crates/cashu/src/nuts/nut00/token.rs
  6. 1 1
      crates/cashu/src/nuts/nut07.rs
  7. 1 1
      crates/cashu/src/nuts/nut11/mod.rs
  8. 2 2
      crates/cashu/src/nuts/nut18.rs
  9. 1 1
      crates/cashu/src/util/hex.rs
  10. 1 1
      crates/cdk-cli/src/main.rs
  11. 2 2
      crates/cdk-cli/src/nostr_storage.rs
  12. 7 10
      crates/cdk-cli/src/sub_commands/cat_device_login.rs
  13. 3 3
      crates/cdk-cli/src/sub_commands/cat_login.rs
  14. 1 1
      crates/cdk-cli/src/sub_commands/check_spent.rs
  15. 2 2
      crates/cdk-cli/src/sub_commands/create_request.rs
  16. 2 2
      crates/cdk-cli/src/sub_commands/melt.rs
  17. 1 1
      crates/cdk-cli/src/sub_commands/mint.rs
  18. 1 1
      crates/cdk-cli/src/sub_commands/mint_blind_auth.rs
  19. 1 1
      crates/cdk-cli/src/sub_commands/mint_info.rs
  20. 1 1
      crates/cdk-cli/src/sub_commands/pay_request.rs
  21. 1 1
      crates/cdk-cli/src/sub_commands/pending_mints.rs
  22. 2 2
      crates/cdk-cli/src/sub_commands/receive.rs
  23. 1 1
      crates/cdk-cli/src/sub_commands/restore.rs
  24. 1 1
      crates/cdk-cli/src/sub_commands/send.rs
  25. 1 1
      crates/cdk-cli/src/sub_commands/update_mint_url.rs
  26. 1 1
      crates/cdk-cli/src/utils.rs
  27. 1 2
      crates/cdk-common/src/error.rs
  28. 1 2
      crates/cdk-integration-tests/src/bin/start_regtest.rs
  29. 1 4
      crates/cdk-integration-tests/src/init_pure_tests.rs
  30. 3 3
      crates/cdk-integration-tests/src/init_regtest.rs
  31. 4 8
      crates/cdk-integration-tests/src/lib.rs
  32. 2 4
      crates/cdk-lnd/src/lib.rs
  33. 2 2
      crates/cdk-mint-rpc/src/bin/mint_rpc_cli.rs
  34. 3 3
      crates/cdk-mintd/src/config.rs
  35. 2 3
      crates/cdk-mintd/src/main.rs
  36. 1 2
      crates/cdk-payment-processor/src/bin/payment_processor.rs
  37. 1 1
      crates/cdk-payment-processor/src/proto/client.rs
  38. 2 3
      crates/cdk-sqlite/src/wallet/mod.rs

+ 2 - 2
crates/cashu/src/mint_url.rs

@@ -54,9 +54,9 @@ impl MintUrl {
             .skip(1)
             .collect::<Vec<&str>>()
             .join("/");
-        let mut formatted_url = format!("{}://{}", protocol, host);
+        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)
     }

+ 1 - 1
crates/cashu/src/nuts/auth/nut21.rs

@@ -169,7 +169,7 @@ impl std::fmt::Display for RoutePath {
         };
         // Remove the quotes from the JSON string
         let path = json_str.trim_matches('"');
-        write!(f, "{}", path)
+        write!(f, "{path}")
     }
 }
 

+ 1 - 1
crates/cashu/src/nuts/auth/nut22.rs

@@ -231,7 +231,7 @@ impl fmt::Display for BlindAuthToken {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let json_string = serde_json::to_string(&self.auth_proof).map_err(|_| fmt::Error)?;
         let encoded = general_purpose::URL_SAFE.encode(json_string);
-        write!(f, "authA{}", encoded)
+        write!(f, "authA{encoded}")
     }
 }
 

+ 1 - 1
crates/cashu/src/nuts/nut00/mod.rs

@@ -570,7 +570,7 @@ impl fmt::Display for PaymentMethod {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
             PaymentMethod::Bolt11 => write!(f, "bolt11"),
-            PaymentMethod::Custom(p) => write!(f, "{}", p),
+            PaymentMethod::Custom(p) => write!(f, "{p}"),
         }
     }
 }

+ 3 - 3
crates/cashu/src/nuts/nut00/token.rs

@@ -33,7 +33,7 @@ impl fmt::Display for Token {
             Self::TokenV4(token) => token.to_string(),
         };
 
-        write!(f, "{}", token)
+        write!(f, "{token}")
     }
 }
 
@@ -300,7 +300,7 @@ impl fmt::Display for TokenV3 {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let json_string = serde_json::to_string(self).map_err(|_| fmt::Error)?;
         let encoded = general_purpose::URL_SAFE.encode(json_string);
-        write!(f, "cashuA{}", encoded)
+        write!(f, "cashuA{encoded}")
     }
 }
 
@@ -387,7 +387,7 @@ impl fmt::Display for TokenV4 {
         let mut data = Vec::new();
         ciborium::into_writer(self, &mut data).map_err(|e| fmt::Error::custom(e.to_string()))?;
         let encoded = general_purpose::URL_SAFE.encode(data);
-        write!(f, "cashuB{}", encoded)
+        write!(f, "cashuB{encoded}")
     }
 }
 

+ 1 - 1
crates/cashu/src/nuts/nut07.rs

@@ -49,7 +49,7 @@ impl fmt::Display for State {
             Self::PendingSpent => "PENDING_SPENT",
         };
 
-        write!(f, "{}", s)
+        write!(f, "{s}")
     }
 }
 

+ 1 - 1
crates/cashu/src/nuts/nut11/mod.rs

@@ -575,7 +575,7 @@ impl fmt::Display for TagKind {
             Self::Locktime => write!(f, "locktime"),
             Self::Refund => write!(f, "refund"),
             Self::Pubkeys => write!(f, "pubkeys"),
-            Self::Custom(kind) => write!(f, "{}", kind),
+            Self::Custom(kind) => write!(f, "{kind}"),
         }
     }
 }

+ 2 - 2
crates/cashu/src/nuts/nut18.rs

@@ -45,7 +45,7 @@ impl fmt::Display for TransportType {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use serde::ser::Error;
         let t = serde_json::to_string(self).map_err(|e| fmt::Error::custom(e.to_string()))?;
-        write!(f, "{}", t)
+        write!(f, "{t}")
     }
 }
 
@@ -278,7 +278,7 @@ impl fmt::Display for PaymentRequest {
         let mut data = Vec::new();
         ciborium::into_writer(self, &mut data).map_err(|e| fmt::Error::custom(e.to_string()))?;
         let encoded = general_purpose::URL_SAFE.encode(data);
-        write!(f, "{}{}", PAYMENT_REQUEST_PREFIX, encoded)
+        write!(f, "{PAYMENT_REQUEST_PREFIX}{encoded}")
     }
 }
 

+ 1 - 1
crates/cashu/src/util/hex.rs

@@ -28,7 +28,7 @@ impl fmt::Display for Error {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
             Self::InvalidHexCharacter { c, index } => {
-                write!(f, "Invalid character {} at position {}", c, index)
+                write!(f, "Invalid character {c} at position {index}")
             }
             Self::OddLength => write!(f, "Odd number of digits"),
         }

+ 1 - 1
crates/cdk-cli/src/main.rs

@@ -100,7 +100,7 @@ async fn main() -> Result<()> {
 
     let sqlx_filter = "sqlx=warn,hyper_util=warn,reqwest=warn";
 
-    let env_filter = EnvFilter::new(format!("{},{}", default_filter, sqlx_filter));
+    let env_filter = EnvFilter::new(format!("{default_filter},{sqlx_filter}"));
 
     // Parse input
     tracing_subscriber::fmt().with_env_filter(env_filter).init();

+ 2 - 2
crates/cdk-cli/src/nostr_storage.rs

@@ -12,7 +12,7 @@ pub async fn store_nostr_last_checked(
     last_checked: u32,
 ) -> Result<()> {
     let key_hex = hex::encode(verifying_key.to_bytes());
-    let file_path = work_dir.join(format!("nostr_last_checked_{}", key_hex));
+    let file_path = work_dir.join(format!("nostr_last_checked_{key_hex}"));
 
     fs::write(file_path, last_checked.to_string())?;
 
@@ -25,7 +25,7 @@ pub async fn get_nostr_last_checked(
     verifying_key: &PublicKey,
 ) -> Result<Option<u32>> {
     let key_hex = hex::encode(verifying_key.to_bytes());
-    let file_path = work_dir.join(format!("nostr_last_checked_{}", key_hex));
+    let file_path = work_dir.join(format!("nostr_last_checked_{key_hex}"));
 
     match fs::read_to_string(file_path) {
         Ok(content) => {

+ 7 - 10
crates/cdk-cli/src/sub_commands/cat_device_login.rs

@@ -60,7 +60,7 @@ pub async fn cat_device_login(
     if let Err(e) =
         token_storage::save_tokens(work_dir, &mint_url, &access_token, &refresh_token).await
     {
-        println!("Warning: Failed to save tokens to file: {}", e);
+        println!("Warning: Failed to save tokens to file: {e}");
     } else {
         println!("Tokens saved to work directory");
     }
@@ -68,8 +68,8 @@ pub async fn cat_device_login(
     // Print a cute ASCII cat
     println!("\nAuthentication successful! 🎉\n");
     println!("\nYour tokens:");
-    println!("access_token: {}", access_token);
-    println!("refresh_token: {}", refresh_token);
+    println!("access_token: {access_token}");
+    println!("refresh_token: {refresh_token}");
 
     Ok(())
 }
@@ -125,14 +125,11 @@ async fn get_device_code_token(mint_info: &MintInfo, client_id: &str) -> (String
 
     let interval = device_code_data["interval"].as_u64().unwrap_or(5);
 
-    println!("\nTo login, visit: {}", verification_uri);
-    println!("And enter code: {}\n", user_code);
+    println!("\nTo login, visit: {verification_uri}");
+    println!("And enter code: {user_code}\n");
 
     if verification_uri_complete != verification_uri {
-        println!(
-            "Or visit this URL directly: {}\n",
-            verification_uri_complete
-        );
+        println!("Or visit this URL directly: {verification_uri_complete}\n");
     }
 
     // Poll for the token
@@ -187,7 +184,7 @@ async fn get_device_code_token(mint_info: &MintInfo, client_id: &str) -> (String
                 continue;
             } else {
                 // For other errors, exit with an error message
-                panic!("Authentication failed: {}", error);
+                panic!("Authentication failed: {error}");
             }
         }
     }

+ 3 - 3
crates/cdk-cli/src/sub_commands/cat_login.rs

@@ -67,15 +67,15 @@ pub async fn cat_login(
     if let Err(e) =
         token_storage::save_tokens(work_dir, &mint_url, &access_token, &refresh_token).await
     {
-        println!("Warning: Failed to save tokens to file: {}", e);
+        println!("Warning: Failed to save tokens to file: {e}");
     } else {
         println!("Tokens saved to work directory");
     }
 
     println!("\nAuthentication successful! 🎉\n");
     println!("\nYour tokens:");
-    println!("access_token: {}", access_token);
-    println!("refresh_token: {}", refresh_token);
+    println!("access_token: {access_token}");
+    println!("refresh_token: {refresh_token}");
 
     Ok(())
 }

+ 1 - 1
crates/cdk-cli/src/sub_commands/check_spent.rs

@@ -5,7 +5,7 @@ pub async fn check_spent(multi_mint_wallet: &MultiMintWallet) -> Result<()> {
     for wallet in multi_mint_wallet.get_wallets().await {
         let amount = wallet.check_all_pending_proofs().await?;
 
-        println!("Amount marked as spent: {}", amount);
+        println!("Amount marked as spent: {amount}");
     }
 
     Ok(())

+ 2 - 2
crates/cdk-cli/src/sub_commands/create_request.rs

@@ -50,7 +50,7 @@ pub async fn create_request(
         transports: vec![nostr_transport],
     };
 
-    println!("{}", req);
+    println!("{req}");
 
     let client = NostrClient::new(keys);
 
@@ -86,7 +86,7 @@ pub async fn create_request(
                     .receive(&token.to_string(), ReceiveOptions::default())
                     .await?;
 
-                println!("Received {}", amount);
+                println!("Received {amount}");
                 exit = true;
             }
             Ok(exit) // Set to true to exit from the loop

+ 2 - 2
crates/cdk-cli/src/sub_commands/melt.rs

@@ -163,13 +163,13 @@ pub async fn pay(
 
         // Process payment
         let quote = wallet.melt_quote(bolt11.to_string(), options).await?;
-        println!("{:?}", quote);
+        println!("{quote:?}");
 
         let melt = wallet.melt(&quote.id).await?;
         println!("Paid invoice: {}", melt.state);
 
         if let Some(preimage) = melt.preimage {
-            println!("Payment preimage: {}", preimage);
+            println!("Payment preimage: {preimage}");
         }
     }
 

+ 1 - 1
crates/cdk-cli/src/sub_commands/mint.rs

@@ -46,7 +46,7 @@ pub async fn mint(
                 .ok_or(anyhow!("Amount must be defined"))?;
             let quote = wallet.mint_quote(Amount::from(amount), description).await?;
 
-            println!("Quote: {:#?}", quote);
+            println!("Quote: {quote:#?}");
 
             println!("Please pay: {}", quote.request);
 

+ 1 - 1
crates/cdk-cli/src/sub_commands/mint_blind_auth.rs

@@ -97,7 +97,7 @@ pub async fn mint_blind_auth(
                         )
                         .await
                         {
-                            println!("Warning: Failed to save refreshed tokens: {}", e);
+                            println!("Warning: Failed to save refreshed tokens: {e}");
                         }
 
                         // Try setting the new access token

+ 1 - 1
crates/cdk-cli/src/sub_commands/mint_info.rs

@@ -19,7 +19,7 @@ pub async fn mint_info(proxy: Option<Url>, sub_command_args: &MintInfoSubcommand
 
     let info = client.get_mint_info().await?;
 
-    println!("{:#?}", info);
+    println!("{info:#?}");
 
     Ok(())
 }

+ 1 - 1
crates/cdk-cli/src/sub_commands/pay_request.rs

@@ -162,7 +162,7 @@ pub async fn pay_request(
             if status.is_success() {
                 println!("Successfully posted payment");
             } else {
-                println!("{:?}", res);
+                println!("{res:?}");
                 println!("Error posting payment");
             }
         }

+ 1 - 1
crates/cdk-cli/src/sub_commands/pending_mints.rs

@@ -5,7 +5,7 @@ pub async fn mint_pending(multi_mint_wallet: &MultiMintWallet) -> Result<()> {
     let amounts = multi_mint_wallet.check_all_mint_quotes(None).await?;
 
     for (unit, amount) in amounts {
-        println!("Unit: {}, Amount: {}", unit, amount);
+        println!("Unit: {unit}, Amount: {amount}");
     }
 
     Ok(())

+ 2 - 2
crates/cdk-cli/src/sub_commands/receive.rs

@@ -115,7 +115,7 @@ pub async fn receive(
                         total_amount += amount;
                     }
                     Err(err) => {
-                        println!("{}", err);
+                        println!("{err}");
                     }
                 }
             }
@@ -124,7 +124,7 @@ pub async fn receive(
         }
     };
 
-    println!("Received: {}", amount);
+    println!("Received: {amount}");
 
     Ok(())
 }

+ 1 - 1
crates/cdk-cli/src/sub_commands/restore.rs

@@ -37,7 +37,7 @@ pub async fn restore(
 
     let amount = wallet.restore().await?;
 
-    println!("Restored {}", amount);
+    println!("Restored {amount}");
 
     Ok(())
 }

+ 1 - 1
crates/cdk-cli/src/sub_commands/send.rs

@@ -169,7 +169,7 @@ pub async fn send(
             println!("{}", token.to_v3_string());
         }
         false => {
-            println!("{}", token);
+            println!("{token}");
         }
     }
 

+ 1 - 1
crates/cdk-cli/src/sub_commands/update_mint_url.rs

@@ -33,7 +33,7 @@ pub async fn update_mint_url(
 
     wallet.update_mint_url(new_mint_url.clone()).await?;
 
-    println!("Mint Url changed from {} to {}", old_mint_url, new_mint_url);
+    println!("Mint Url changed from {old_mint_url} to {new_mint_url}");
 
     Ok(())
 }

+ 1 - 1
crates/cdk-cli/src/utils.rs

@@ -10,7 +10,7 @@ use cdk::Amount;
 
 /// Helper function to get user input with a prompt
 pub fn get_user_input(prompt: &str) -> Result<String> {
-    println!("{}", prompt);
+    println!("{prompt}");
     let mut user_input = String::new();
     io::stdout().flush()?;
     io::stdin().read_line(&mut user_input)?;

+ 1 - 2
crates/cdk-common/src/error.rs

@@ -407,8 +407,7 @@ impl From<Error> for ErrorResponse {
                 ErrorResponse {
                     code: ErrorCode::TransactionUnbalanced,
                     error: Some(format!(
-                        "Inputs: {}, Outputs: {}, expected_fee: {}",
-                        inputs_total, outputs_total, fee_expected,
+                        "Inputs: {inputs_total}, Outputs: {outputs_total}, expected_fee: {fee_expected}",
                     )),
                     detail: Some("Transaction inputs should equal outputs less fee".to_string()),
                 }

+ 1 - 2
crates/cdk-integration-tests/src/bin/start_regtest.rs

@@ -31,8 +31,7 @@ async fn main() -> Result<()> {
     let rustls_filter = "rustls=warn";
 
     let env_filter = EnvFilter::new(format!(
-        "{},{},{},{},{}",
-        default_filter, sqlx_filter, hyper_filter, h2_filter, rustls_filter
+        "{default_filter},{sqlx_filter},{hyper_filter},{h2_filter},{rustls_filter}"
     ));
 
     tracing_subscriber::fmt().with_env_filter(env_filter).init();

+ 1 - 4
crates/cdk-integration-tests/src/init_pure_tests.rs

@@ -166,10 +166,7 @@ pub fn setup_tracing() {
     let sqlx_filter = "sqlx=warn";
     let hyper_filter = "hyper=warn";
 
-    let env_filter = EnvFilter::new(format!(
-        "{},{},{}",
-        default_filter, sqlx_filter, hyper_filter
-    ));
+    let env_filter = EnvFilter::new(format!("{default_filter},{sqlx_filter},{hyper_filter}"));
 
     // Ok if successful, Err if already initialized
     // Allows us to setup tracing at the start of several parallel tests

+ 3 - 3
crates/cdk-integration-tests/src/init_regtest.rs

@@ -36,7 +36,7 @@ pub fn get_mint_addr() -> String {
 }
 
 pub fn get_mint_port(which: &str) -> u16 {
-    let dir = env::var(format!("CDK_ITESTS_MINT_PORT_{}", which)).expect("Mint port not set");
+    let dir = env::var(format!("CDK_ITESTS_MINT_PORT_{which}")).expect("Mint port not set");
     dir.parse().unwrap()
 }
 
@@ -244,7 +244,7 @@ pub async fn start_regtest_end(sender: Sender<()>, notify: Arc<Notify>) -> anyho
     tracing::info!("Started lnd node");
 
     let lnd_client = LndClient::new(
-        format!("https://{}", LND_RPC_ADDR),
+        format!("https://{LND_RPC_ADDR}"),
         get_lnd_cert_file_path(&lnd_dir),
         get_lnd_macaroon_path(&lnd_dir),
     )
@@ -261,7 +261,7 @@ pub async fn start_regtest_end(sender: Sender<()>, notify: Arc<Notify>) -> anyho
     tracing::info!("Started second lnd node");
 
     let lnd_two_client = LndClient::new(
-        format!("https://{}", LND_TWO_RPC_ADDR),
+        format!("https://{LND_TWO_RPC_ADDR}"),
         get_lnd_cert_file_path(&lnd_two_dir),
         get_lnd_macaroon_path(&lnd_two_dir),
     )

+ 4 - 8
crates/cdk-integration-tests/src/lib.rs

@@ -60,7 +60,7 @@ pub async fn attempt_to_swap_pending(wallet: &Wallet) -> Result<()> {
         Err(err) => match err {
             cdk::error::Error::TokenPending => (),
             _ => {
-                println!("{:?}", err);
+                println!("{err:?}");
                 bail!("Wrong error")
             }
         },
@@ -154,13 +154,9 @@ pub async fn init_lnd_client() -> LndClient {
     let lnd_dir = get_lnd_dir("one");
     let cert_file = lnd_dir.join("tls.cert");
     let macaroon_file = lnd_dir.join("data/chain/bitcoin/regtest/admin.macaroon");
-    LndClient::new(
-        format!("https://{}", LND_RPC_ADDR),
-        cert_file,
-        macaroon_file,
-    )
-    .await
-    .unwrap()
+    LndClient::new(format!("https://{LND_RPC_ADDR}"), cert_file, macaroon_file)
+        .await
+        .unwrap()
 }
 
 /// Pays a Bolt11Invoice if it's on the regtest network, otherwise returns Ok

+ 2 - 4
crates/cdk-lnd/src/lib.rs

@@ -70,8 +70,7 @@ impl Lnd {
         // Validate cert_file exists and is not empty
         if !cert_file.exists() || cert_file.metadata().map(|m| m.len() == 0).unwrap_or(true) {
             return Err(Error::InvalidConfig(format!(
-                "LND certificate file not found or empty: {:?}",
-                cert_file
+                "LND certificate file not found or empty: {cert_file:?}"
             )));
         }
 
@@ -83,8 +82,7 @@ impl Lnd {
                 .unwrap_or(true)
         {
             return Err(Error::InvalidConfig(format!(
-                "LND macaroon file not found or empty: {:?}",
-                macaroon_file
+                "LND macaroon file not found or empty: {macaroon_file:?}"
             )));
         }
 

+ 2 - 2
crates/cdk-mint-rpc/src/bin/mint_rpc_cli.rs

@@ -74,7 +74,7 @@ async fn main() -> Result<()> {
 
     let sqlx_filter = "sqlx=warn,hyper_util=warn,reqwest=warn";
 
-    let env_filter = EnvFilter::new(format!("{},{}", default_filter, sqlx_filter));
+    let env_filter = EnvFilter::new(format!("{default_filter},{sqlx_filter}"));
 
     // Parse input
     tracing_subscriber::fmt().with_env_filter(env_filter).init();
@@ -141,7 +141,7 @@ async fn main() -> Result<()> {
             println!("icon_url: {}", info.icon_url.unwrap_or("None".to_string()));
 
             for url in info.urls {
-                println!("mint_url: {}", url);
+                println!("mint_url: {url}");
             }
 
             for contact in info.contact {

+ 3 - 3
crates/cdk-mintd/src/config.rs

@@ -29,7 +29,7 @@ impl std::fmt::Debug for Info {
         // Use a fallback approach that won't panic
         let mnemonic_display = {
             let hash = sha256::Hash::hash(self.mnemonic.clone().into_bytes().as_ref());
-            format!("<hashed: {}>", hash)
+            format!("<hashed: {hash}>")
         };
 
         f.debug_struct("Info")
@@ -76,7 +76,7 @@ impl std::str::FromStr for LnBackend {
             "lnd" => Ok(LnBackend::Lnd),
             #[cfg(feature = "grpc-processor")]
             "grpcprocessor" => Ok(LnBackend::GrpcProcessor),
-            _ => Err(format!("Unknown Lightning backend: {}", s)),
+            _ => Err(format!("Unknown Lightning backend: {s}")),
         }
     }
 }
@@ -195,7 +195,7 @@ impl std::str::FromStr for DatabaseEngine {
             "sqlite" => Ok(DatabaseEngine::Sqlite),
             #[cfg(feature = "redb")]
             "redb" => Ok(DatabaseEngine::Redb),
-            _ => Err(format!("Unknown database engine: {}", s)),
+            _ => Err(format!("Unknown database engine: {s}")),
         }
     }
 }

+ 2 - 3
crates/cdk-mintd/src/main.rs

@@ -82,8 +82,7 @@ async fn main() -> anyhow::Result<()> {
     let tower_http = "tower_http=warn";
 
     let env_filter = EnvFilter::new(format!(
-        "{},{},{},{},{}",
-        default_filter, sqlx_filter, hyper_filter, h2_filter, tower_http
+        "{default_filter},{sqlx_filter},{hyper_filter},{h2_filter},{tower_http}"
     ));
 
     tracing_subscriber::fmt().with_env_filter(env_filter).init();
@@ -633,7 +632,7 @@ async fn main() -> anyhow::Result<()> {
         mint.set_quote_ttl(QuoteTTL::new(10_000, 10_000)).await?;
     }
 
-    let socket_addr = SocketAddr::from_str(&format!("{}:{}", listen_addr, listen_port))?;
+    let socket_addr = SocketAddr::from_str(&format!("{listen_addr}:{listen_port}"))?;
 
     let listener = tokio::net::TcpListener::bind(socket_addr).await?;
 

+ 1 - 2
crates/cdk-payment-processor/src/bin/payment_processor.rs

@@ -46,8 +46,7 @@ async fn main() -> anyhow::Result<()> {
     let rustls_filter = "rustls=warn";
 
     let env_filter = EnvFilter::new(format!(
-        "{},{},{},{},{}",
-        default_filter, sqlx_filter, hyper_filter, h2_filter, rustls_filter
+        "{default_filter},{sqlx_filter},{hyper_filter},{h2_filter},{rustls_filter}"
     ));
 
     tracing_subscriber::fmt().with_env_filter(env_filter).init();

+ 1 - 1
crates/cdk-payment-processor/src/proto/client.rs

@@ -34,7 +34,7 @@ pub struct PaymentProcessorClient {
 impl PaymentProcessorClient {
     /// Payment Processor
     pub async fn new(addr: &str, port: u16, tls_dir: Option<PathBuf>) -> anyhow::Result<Self> {
-        let addr = format!("{}:{}", addr, port);
+        let addr = format!("{addr}:{port}");
         let channel = if let Some(tls_dir) = tls_dir {
             // TLS directory exists, configure TLS
 

+ 2 - 3
crates/cdk-sqlite/src/wallet/mod.rs

@@ -246,11 +246,10 @@ FROM mint
         for table in &tables {
             let query = format!(
                 r#"
-            UPDATE {}
+            UPDATE {table}
             SET mint_url = ?
             WHERE mint_url = ?;
-            "#,
-                table
+            "#
             );
 
             sqlx::query(&query)