Skip to content

Commit 5569ccc

Browse files
committed
fix(clippy): use is_none_or instead of map_or
- use `is_non_or` instead of `map_or` - update lifetime on `find_direct_anchor`
1 parent 3885014 commit 5569ccc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

crates/chain/src/canonical_view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ impl<A: Anchor> CanonicalView<A> {
9393
where
9494
C: ChainOracle,
9595
{
96-
fn find_direct_anchor<'g, A: Anchor, C: ChainOracle>(
97-
tx_node: &TxNode<'g, Arc<Transaction>, A>,
96+
fn find_direct_anchor<A: Anchor, C: ChainOracle>(
97+
tx_node: &TxNode<'_, Arc<Transaction>, A>,
9898
chain: &C,
9999
chain_tip: BlockId,
100100
) -> Result<Option<A>, C::Error> {

crates/chain/src/indexer/keychain_txout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ impl Merge for ChangeSet {
10581058
debug_assert!(
10591059
orig_spks
10601060
.iter()
1061-
.all(|(i, orig_spk)| spks.get(i).map_or(true, |spk| spk == orig_spk)),
1061+
.all(|(i, orig_spk)| spks.get(i).is_none_or(|spk| spk == orig_spk)),
10621062
"spk of the same descriptor-id and derivation index must not be different"
10631063
);
10641064
orig_spks.extend(spks);

crates/electrum/src/bdk_electrum_client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ fn chain_update(
695695

696696
#[cfg(test)]
697697
#[cfg_attr(coverage_nightly, coverage(off))]
698+
#[allow(unused_imports)]
698699
mod test {
699700
use crate::{bdk_electrum_client::TxUpdate, electrum_client::ElectrumApi, BdkElectrumClient};
700701
use bdk_chain::bitcoin::Amount;

0 commit comments

Comments
 (0)