- use `is_non_or` instead of `map_or`
- update lifetime on `find_direct_anchor`
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> {
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);
#[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;