From 7c1303ad9544a578887c12809b18f1c7d0ecc068 Mon Sep 17 00:00:00 2001 From: Vadim Anufriev Date: Sat, 7 Feb 2026 23:10:08 +0400 Subject: [PATCH] chore(clippy): resolve clippy warngins --- src/payjoin/mod.rs | 17 ++++++++--------- src/utils.rs | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/payjoin/mod.rs b/src/payjoin/mod.rs index f5e1274..5d1efc0 100644 --- a/src/payjoin/mod.rs +++ b/src/payjoin/mod.rs @@ -75,7 +75,7 @@ impl<'a> PayjoinManager<'a> { let persister = payjoin::persist::NoopSessionPersister::::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); diff --git a/src/utils.rs b/src/utils.rs index 73d3453..4514bb5 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -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, -- 2.49.0