]> Untitled Git - bdk-cli/commitdiff
chore(clippy): resolve clippy warngins
authorVadim Anufriev <mailbox@vaan.io>
Sat, 7 Feb 2026 19:10:08 +0000 (23:10 +0400)
committerVadim Anufriev <mailbox@vaan.io>
Sat, 7 Feb 2026 19:10:08 +0000 (23:10 +0400)
src/payjoin/mod.rs
src/utils.rs

index f5e1274ca1acfa0a5085da1e0296fadcbc281798..5d1efc045858829fa0b411a0bc7e9f51627e5795 100644 (file)
@@ -75,7 +75,7 @@ impl<'a> PayjoinManager<'a> {
         let persister = payjoin::persist::NoopSessionPersister::<ReceiverSessionEvent>::default();
 
         let checked_max_fee_rate = max_fee_rate
-            .map(|rate| FeeRate::from_sat_per_kwu(rate))
+            .map(FeeRate::from_sat_per_kwu)
             .unwrap_or(FeeRate::BROADCAST_MIN);
 
         let receiver = payjoin::receive::v2::ReceiverBuilder::new(
@@ -296,7 +296,7 @@ impl<'a> PayjoinManager<'a> {
                     .await
             }
             ReceiveSession::HasReplyableError(error) => self.handle_error(error, persister).await,
-            ReceiveSession::Closed(_) => return Err(Error::Generic("Session closed".to_string())),
+            ReceiveSession::Closed(_) => Err(Error::Generic("Session closed".to_string())),
         }
     }
 
@@ -334,7 +334,7 @@ impl<'a> PayjoinManager<'a> {
                 Err(e) => {
                     return Err(Error::Generic(format!(
                         "Error occurred when polling for Payjoin proposal from the directory: {}",
-                        e.to_string()
+                        e
                     )));
                 }
             }
@@ -637,16 +637,15 @@ impl<'a> PayjoinManager<'a> {
                         return Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"));
                     };
 
-                    let is_seen = match tx_details.chain_position {
-                        bdk_wallet::chain::ChainPosition::Confirmed { .. } => true,
-                        bdk_wallet::chain::ChainPosition::Unconfirmed { first_seen: Some(_), .. } => true,
-                        _ => false
-                    };
+                    let is_seen = matches!(
+                        tx_details.chain_position, bdk_wallet::chain::ChainPosition::Confirmed { .. }
+                        | bdk_wallet::chain::ChainPosition::Unconfirmed { first_seen: Some(_), .. }
+                    );
 
                     if is_seen {
                         return Ok(Some(tx_details.tx.as_ref().clone()));
                     }
-                    return Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"));
+                    Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"))
                 },
                 |outpoint| {
                     let utxo = self.wallet.get_utxo(outpoint);
index 73d345312c8c5f819e0b3e397609fada73c24570..4514bb56c5efd0d83950a0ddea673b4baecab31e 100644 (file)
@@ -187,7 +187,7 @@ pub(crate) fn new_blockchain_client(
         }
         #[cfg(feature = "esplora")]
         ClientType::Esplora => {
-            let client = bdk_esplora::esplora_client::Builder::new(&url).build_async()?;
+            let client = bdk_esplora::esplora_client::Builder::new(url).build_async()?;
             BlockchainClient::Esplora {
                 client: Box::new(client),
                 parallel_requests: wallet_opts.parallel_requests,