Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Feb 23, 2025
1 parent fd88590 commit fcf9eaf
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crates/cdk-cln/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl MintPayment for Cln {
unit: &CurrencyUnit,
options: Option<MeltOptions>,
) -> Result<PaymentQuoteResponse, Self::Err> {
let bolt11 = Bolt11Invoice::from_str(&request)?;
let bolt11 = Bolt11Invoice::from_str(request)?;

let amount_msat = match options {
Some(amount) => amount.amount_msat(),
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-fake-wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl MintPayment for FakeWallet {
unit: &CurrencyUnit,
options: Option<MeltOptions>,
) -> Result<PaymentQuoteResponse, Self::Err> {
let bolt11 = Bolt11Invoice::from_str(&request)?;
let bolt11 = Bolt11Invoice::from_str(request)?;

let amount_msat = match options {
Some(amount) => amount.amount_msat(),
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-integration-tests/src/bin/regtest_mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async fn main() -> Result<()> {
.expect("Error starting regtest");
});

match timeout(Duration::from_secs(300), async { rx.await }).await {
match timeout(Duration::from_secs(300), rx).await {
Ok(_) => {}
Err(_) => {
tracing::error!("regtest setup timed out after 5 minutes");
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-integration-tests/src/bin/start_regtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async fn main() -> Result<()> {
.expect("Error starting regtest");
});

match timeout(Duration::from_secs(300), async { rx.await }).await {
match timeout(Duration::from_secs(300), rx).await {
Ok(_) => {
tracing::info!("Regtest set up");
signal_progress();
Expand Down
1 change: 1 addition & 0 deletions crates/cdk-integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ pub async fn attempt_to_swap_pending(wallet: &Wallet) -> Result<()> {
Ok(())
}

#[allow(clippy::incompatible_msrv)]
pub async fn wait_for_mint_to_be_paid(
wallet: &Wallet,
mint_quote_id: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-lnbits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl MintPayment for LNbits {
return Err(Self::Err::Anyhow(anyhow!("Unsupported unit")));
}

let bolt11 = Bolt11Invoice::from_str(&request)?;
let bolt11 = Bolt11Invoice::from_str(request)?;

let amount_msat = match options {
Some(amount) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-lnd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl MintPayment for Lnd {
unit: &CurrencyUnit,
options: Option<MeltOptions>,
) -> Result<PaymentQuoteResponse, Self::Err> {
let bolt11 = Bolt11Invoice::from_str(&request)?;
let bolt11 = Bolt11Invoice::from_str(request)?;

let amount_msat = match options {
Some(amount) => amount.amount_msat(),
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-payment-processor/src/bin/payment_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn main() -> anyhow::Result<()> {
let listen_port: u16 = env::var(ENV_LISTEN_PORT)?.parse()?;
let tls_dir: Option<PathBuf> = env::var(ENV_PAYMENT_PROCESSOR_TLS_DIR)
.ok()
.map(|p| PathBuf::from(p));
.map(PathBuf::from);

let ln_backed: Arc<dyn MintPayment<Err = payment::Error> + Send + Sync> =
match ln_backend.as_str() {
Expand Down
13 changes: 4 additions & 9 deletions crates/cdk-payment-processor/src/proto/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,10 @@ impl CdkPaymentProcessor for PaymentProcessorServer {
) -> Result<Response<PaymentQuoteResponse>, Status> {
let request = request.into_inner();

let options: Option<cdk_common::MeltOptions> = match &request.options {
Some(options) => Some(
options
.clone()
.try_into()
.map_err(|_| Status::invalid_argument("Invalid melt options"))?,
),
None => None,
};
let options: Option<cdk_common::MeltOptions> = request
.options
.as_ref()
.map(|options| options.clone().into());

let payment_quote = self
.inner
Expand Down

0 comments on commit fcf9eaf

Please sign in to comment.