]> Untitled Git - bdk/commitdiff
fix(clippy): use `is_none_or` instead of `map_or`
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Thu, 2 Oct 2025 04:49:44 +0000 (14:49 +1000)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Thu, 9 Oct 2025 03:23:37 +0000 (14:23 +1100)
- use `is_non_or` instead of `map_or`
- update lifetime on `find_direct_anchor`

crates/chain/src/canonical_view.rs
crates/chain/src/indexer/keychain_txout.rs
crates/electrum/src/bdk_electrum_client.rs

index 09b18e50a19dd054da8a5ac8b9ed797b6a69f7f7..8567db10d88c1fd623791467a031cec184e8f1d2 100644 (file)
@@ -93,8 +93,8 @@ impl<A: Anchor> CanonicalView<A> {
     where
         C: ChainOracle,
     {
-        fn find_direct_anchor<'g, A: Anchor, C: ChainOracle>(
-            tx_node: &TxNode<'g, Arc<Transaction>, A>,
+        fn find_direct_anchor<A: Anchor, C: ChainOracle>(
+            tx_node: &TxNode<'_, Arc<Transaction>, A>,
             chain: &C,
             chain_tip: BlockId,
         ) -> Result<Option<A>, C::Error> {
index b99a6a224241e663234620b4f7790a01086ed75e..99931cf5ed5f7a5e3bed6e5783ab88da961200f4 100644 (file)
@@ -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);
index ea14fa14e29555b72565e2786e2fdf5e425a166d..05b5018710136f407b386339617ba55223116253 100644 (file)
@@ -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;