Skip to content

Commit 7c1303a

Browse files
committed
chore(clippy): resolve clippy warngins
1 parent 82e6628 commit 7c1303a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/payjoin/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'a> PayjoinManager<'a> {
7575
let persister = payjoin::persist::NoopSessionPersister::<ReceiverSessionEvent>::default();
7676

7777
let checked_max_fee_rate = max_fee_rate
78-
.map(|rate| FeeRate::from_sat_per_kwu(rate))
78+
.map(FeeRate::from_sat_per_kwu)
7979
.unwrap_or(FeeRate::BROADCAST_MIN);
8080

8181
let receiver = payjoin::receive::v2::ReceiverBuilder::new(
@@ -296,7 +296,7 @@ impl<'a> PayjoinManager<'a> {
296296
.await
297297
}
298298
ReceiveSession::HasReplyableError(error) => self.handle_error(error, persister).await,
299-
ReceiveSession::Closed(_) => return Err(Error::Generic("Session closed".to_string())),
299+
ReceiveSession::Closed(_) => Err(Error::Generic("Session closed".to_string())),
300300
}
301301
}
302302

@@ -334,7 +334,7 @@ impl<'a> PayjoinManager<'a> {
334334
Err(e) => {
335335
return Err(Error::Generic(format!(
336336
"Error occurred when polling for Payjoin proposal from the directory: {}",
337-
e.to_string()
337+
e
338338
)));
339339
}
340340
}
@@ -637,16 +637,15 @@ impl<'a> PayjoinManager<'a> {
637637
return Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"));
638638
};
639639

640-
let is_seen = match tx_details.chain_position {
641-
bdk_wallet::chain::ChainPosition::Confirmed { .. } => true,
642-
bdk_wallet::chain::ChainPosition::Unconfirmed { first_seen: Some(_), .. } => true,
643-
_ => false
644-
};
640+
let is_seen = matches!(
641+
tx_details.chain_position, bdk_wallet::chain::ChainPosition::Confirmed { .. }
642+
| bdk_wallet::chain::ChainPosition::Unconfirmed { first_seen: Some(_), .. }
643+
);
645644

646645
if is_seen {
647646
return Ok(Some(tx_details.tx.as_ref().clone()));
648647
}
649-
return Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"));
648+
Err(ImplementationError::from("Cannot find the transaction in the mempool or the blockchain"))
650649
},
651650
|outpoint| {
652651
let utxo = self.wallet.get_utxo(outpoint);

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pub(crate) fn new_blockchain_client(
187187
}
188188
#[cfg(feature = "esplora")]
189189
ClientType::Esplora => {
190-
let client = bdk_esplora::esplora_client::Builder::new(&url).build_async()?;
190+
let client = bdk_esplora::esplora_client::Builder::new(url).build_async()?;
191191
BlockchainClient::Esplora {
192192
client: Box::new(client),
193193
parallel_requests: wallet_opts.parallel_requests,

0 commit comments

Comments
 (0)