From: Leonardo Lima Date: Thu, 2 Oct 2025 04:49:44 +0000 (+1000) Subject: fix(clippy): use `is_none_or` instead of `map_or` X-Git-Url: http://internal-gitweb-vhost/?a=commitdiff_plain;h=6b67a3409bfda1b9294d705f83cf69d3dcdbd19d;p=bdk fix(clippy): use `is_none_or` instead of `map_or` - use `is_non_or` instead of `map_or` - update lifetime on `find_direct_anchor` --- diff --git a/crates/chain/src/canonical_view.rs b/crates/chain/src/canonical_view.rs index 09b18e50..8567db10 100644 --- a/crates/chain/src/canonical_view.rs +++ b/crates/chain/src/canonical_view.rs @@ -93,8 +93,8 @@ impl CanonicalView { where C: ChainOracle, { - fn find_direct_anchor<'g, A: Anchor, C: ChainOracle>( - tx_node: &TxNode<'g, Arc, A>, + fn find_direct_anchor( + tx_node: &TxNode<'_, Arc, A>, chain: &C, chain_tip: BlockId, ) -> Result, C::Error> { diff --git a/crates/chain/src/indexer/keychain_txout.rs b/crates/chain/src/indexer/keychain_txout.rs index b99a6a22..99931cf5 100644 --- a/crates/chain/src/indexer/keychain_txout.rs +++ b/crates/chain/src/indexer/keychain_txout.rs @@ -1058,7 +1058,7 @@ impl Merge for ChangeSet { debug_assert!( orig_spks .iter() - .all(|(i, orig_spk)| spks.get(i).map_or(true, |spk| spk == orig_spk)), + .all(|(i, orig_spk)| spks.get(i).is_none_or(|spk| spk == orig_spk)), "spk of the same descriptor-id and derivation index must not be different" ); orig_spks.extend(spks); diff --git a/crates/electrum/src/bdk_electrum_client.rs b/crates/electrum/src/bdk_electrum_client.rs index ea14fa14..05b50187 100644 --- a/crates/electrum/src/bdk_electrum_client.rs +++ b/crates/electrum/src/bdk_electrum_client.rs @@ -695,6 +695,7 @@ fn chain_update( #[cfg(test)] #[cfg_attr(coverage_nightly, coverage(off))] +#[allow(unused_imports)] mod test { use crate::{bdk_electrum_client::TxUpdate, electrum_client::ElectrumApi, BdkElectrumClient}; use bdk_chain::bitcoin::Amount;