diff --git a/crates/chain/src/tx_data_traits.rs b/crates/chain/src/tx_data_traits.rs index e39f975d9..74d1021f6 100644 --- a/crates/chain/src/tx_data_traits.rs +++ b/crates/chain/src/tx_data_traits.rs @@ -76,7 +76,7 @@ pub trait Anchor: core::fmt::Debug + Clone + Eq + PartialOrd + Ord + core::hash: } } -impl<'a, A: Anchor> Anchor for &'a A { +impl Anchor for &A { fn anchor_block(&self) -> BlockId { ::anchor_block(self) } @@ -112,13 +112,13 @@ pub struct TxPosInBlock<'b> { pub tx_pos: usize, } -impl<'b> From> for BlockId { +impl From> for BlockId { fn from(pos: TxPosInBlock) -> Self { pos.block_id } } -impl<'b> From> for ConfirmationBlockTime { +impl From> for ConfirmationBlockTime { fn from(pos: TxPosInBlock) -> Self { Self { block_id: pos.block_id, diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 0207f242e..2d512cfea 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -183,7 +183,7 @@ pub struct TxNode<'a, T, A> { pub last_seen_unconfirmed: Option, } -impl<'a, T, A> Deref for TxNode<'a, T, A> { +impl Deref for TxNode<'_, T, A> { type Target = T; fn deref(&self) -> &Self::Target { @@ -1350,7 +1350,7 @@ where } } -impl<'g, A, F, O> Iterator for TxAncestors<'g, A, F, O> +impl Iterator for TxAncestors<'_, A, F, O> where F: FnMut(usize, Arc) -> Option, { @@ -1470,7 +1470,7 @@ where } } -impl<'g, A, F, O> Iterator for TxDescendants<'g, A, F, O> +impl Iterator for TxDescendants<'_, A, F, O> where F: FnMut(usize, Txid) -> Option, { diff --git a/crates/chain/tests/test_local_chain.rs b/crates/chain/tests/test_local_chain.rs index e8515c868..a0b8220ee 100644 --- a/crates/chain/tests/test_local_chain.rs +++ b/crates/chain/tests/test_local_chain.rs @@ -30,7 +30,7 @@ enum ExpectedResult<'a> { Err(CannotConnectError), } -impl<'a> TestLocalChain<'a> { +impl TestLocalChain<'_> { fn run(mut self) { let got_changeset = match self.chain.apply_update(self.update) { Ok(changeset) => changeset, diff --git a/crates/core/src/spk_client.rs b/crates/core/src/spk_client.rs index eee4a5371..a5ec813c9 100644 --- a/crates/core/src/spk_client.rs +++ b/crates/core/src/spk_client.rs @@ -21,7 +21,7 @@ pub enum SyncItem<'i, I> { OutPoint(OutPoint), } -impl<'i, I: core::fmt::Debug + core::any::Any> core::fmt::Display for SyncItem<'i, I> { +impl core::fmt::Display for SyncItem<'_, I> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { SyncItem::Spk(i, spk) => { @@ -485,7 +485,7 @@ struct KeychainSpkIter<'r, K> { inspect: &'r mut Box>, } -impl<'r, K: Ord + Clone> Iterator for KeychainSpkIter<'r, K> { +impl Iterator for KeychainSpkIter<'_, K> { type Item = Indexed; fn next(&mut self) -> Option { @@ -511,7 +511,7 @@ impl<'r, I, Item> SyncIter<'r, I, Item> { impl<'r, I, Item> ExactSizeIterator for SyncIter<'r, I, Item> where SyncIter<'r, I, Item>: Iterator {} -impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> { +impl Iterator for SyncIter<'_, I, ScriptBuf> { type Item = ScriptBuf; fn next(&mut self) -> Option { @@ -524,7 +524,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> { } } -impl<'r, I> Iterator for SyncIter<'r, I, Txid> { +impl Iterator for SyncIter<'_, I, Txid> { type Item = Txid; fn next(&mut self) -> Option { @@ -537,7 +537,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, Txid> { } } -impl<'r, I> Iterator for SyncIter<'r, I, OutPoint> { +impl Iterator for SyncIter<'_, I, OutPoint> { type Item = OutPoint; fn next(&mut self) -> Option { diff --git a/crates/file_store/src/entry_iter.rs b/crates/file_store/src/entry_iter.rs index 6be3fd034..ad34c77de 100644 --- a/crates/file_store/src/entry_iter.rs +++ b/crates/file_store/src/entry_iter.rs @@ -33,7 +33,7 @@ impl<'t, T> EntryIter<'t, T> { } } -impl<'t, T> Iterator for EntryIter<'t, T> +impl Iterator for EntryIter<'_, T> where T: serde::de::DeserializeOwned, { @@ -71,7 +71,7 @@ where } } -impl<'t, T> Drop for EntryIter<'t, T> { +impl Drop for EntryIter<'_, T> { fn drop(&mut self) { // This syncs the underlying file's offset with the buffer's position. This way, we // maintain the correct position to start the next read/write. diff --git a/crates/testenv/src/lib.rs b/crates/testenv/src/lib.rs index abf4cac43..2c0f15f64 100644 --- a/crates/testenv/src/lib.rs +++ b/crates/testenv/src/lib.rs @@ -39,7 +39,7 @@ pub struct Config<'a> { pub electrsd: electrsd::Conf<'a>, } -impl<'a> Default for Config<'a> { +impl Default for Config<'_> { /// Use the default configuration plus set `http_enabled = true` for [`electrsd::Conf`] /// which is required for testing `bdk_esplora`. fn default() -> Self { diff --git a/crates/wallet/examples/compiler.rs b/crates/wallet/examples/compiler.rs index d0922fa4e..bf43f3ded 100644 --- a/crates/wallet/examples/compiler.rs +++ b/crates/wallet/examples/compiler.rs @@ -30,7 +30,6 @@ use bdk_wallet::{KeychainKind, Wallet}; /// can be derived from the policy. /// /// This example demonstrates the interaction between a bdk wallet and miniscript policy. - #[allow(clippy::print_stdout)] fn main() -> Result<(), Box> { // We start with a miniscript policy string diff --git a/crates/wallet/examples/policy.rs b/crates/wallet/examples/policy.rs index e64d47b53..2b55a2ebf 100644 --- a/crates/wallet/examples/policy.rs +++ b/crates/wallet/examples/policy.rs @@ -25,7 +25,6 @@ use bdk_wallet::signer::SignersContainer; /// /// This example demos a Policy output for a 2of2 multisig between between 2 parties, where the wallet holds /// one of the Extend Private key. - #[allow(clippy::print_stdout)] fn main() -> Result<(), Box> { let secp = bitcoin::secp256k1::Secp256k1::new(); diff --git a/crates/wallet/src/descriptor/mod.rs b/crates/wallet/src/descriptor/mod.rs index c3dd95da8..1d3b375fc 100644 --- a/crates/wallet/src/descriptor/mod.rs +++ b/crates/wallet/src/descriptor/mod.rs @@ -145,9 +145,7 @@ impl IntoWalletDescriptor for (ExtendedDescriptor, KeyMap) { network: Network, } - impl<'s, 'd> miniscript::Translator - for Translator<'s, 'd> - { + impl miniscript::Translator for Translator<'_, '_> { fn pk(&mut self, pk: &DescriptorPublicKey) -> Result { let secp = &self.secp; diff --git a/crates/wallet/src/keys/mod.rs b/crates/wallet/src/keys/mod.rs index d9c241ff0..f12bcb94d 100644 --- a/crates/wallet/src/keys/mod.rs +++ b/crates/wallet/src/keys/mod.rs @@ -982,7 +982,7 @@ impl fmt::Display for KeyError { impl std::error::Error for KeyError {} #[cfg(test)] -pub mod test { +mod test { use bitcoin::bip32; use super::*; diff --git a/crates/wallet/src/wallet/coin_selection.rs b/crates/wallet/src/wallet/coin_selection.rs index a785c3b28..4429fae73 100644 --- a/crates/wallet/src/wallet/coin_selection.rs +++ b/crates/wallet/src/wallet/coin_selection.rs @@ -898,7 +898,7 @@ mod test { .collect() } - fn sum_random_utxos(mut rng: &mut StdRng, utxos: &mut Vec) -> Amount { + fn sum_random_utxos(mut rng: &mut StdRng, utxos: &mut [WeightedUtxo]) -> Amount { let utxos_picked_len = rng.gen_range(2..utxos.len() / 2); utxos.shuffle(&mut rng); utxos[..utxos_picked_len] diff --git a/crates/wallet/src/wallet/persisted.rs b/crates/wallet/src/wallet/persisted.rs index a8876e8e4..d07c72712 100644 --- a/crates/wallet/src/wallet/persisted.rs +++ b/crates/wallet/src/wallet/persisted.rs @@ -254,7 +254,7 @@ impl PersistedWallet

{ } #[cfg(feature = "rusqlite")] -impl<'c> WalletPersister for bdk_chain::rusqlite::Transaction<'c> { +impl WalletPersister for bdk_chain::rusqlite::Transaction<'_> { type Error = bdk_chain::rusqlite::Error; fn initialize(persister: &mut Self) -> Result { diff --git a/crates/wallet/src/wallet/tx_builder.rs b/crates/wallet/src/wallet/tx_builder.rs index 3eea1eb3a..868d51dfa 100644 --- a/crates/wallet/src/wallet/tx_builder.rs +++ b/crates/wallet/src/wallet/tx_builder.rs @@ -644,7 +644,7 @@ impl<'a, Cs> TxBuilder<'a, Cs> { } } -impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs> { +impl TxBuilder<'_, Cs> { /// Finish building the transaction. /// /// Uses the thread-local random number generator (rng).