]> Untitled Git - bdk/commitdiff
ci(clippy): fix new stricter needless_lifetime errors for rust 1.83
authorSteve Myers <steve@notmandatory.org>
Mon, 16 Dec 2024 01:15:52 +0000 (19:15 -0600)
committerSteve Myers <steve@notmandatory.org>
Mon, 16 Dec 2024 01:53:59 +0000 (19:53 -0600)
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
https://github.com/rust-lang/rust-clippy/pull/13286

crates/chain/src/tx_data_traits.rs
crates/chain/src/tx_graph.rs
crates/chain/tests/test_local_chain.rs
crates/core/src/spk_client.rs
crates/file_store/src/entry_iter.rs
crates/testenv/src/lib.rs
crates/wallet/src/descriptor/mod.rs
crates/wallet/src/wallet/persisted.rs
crates/wallet/src/wallet/tx_builder.rs

index e39f975d9a8f88893f1ba978b2ac1694a91c61c2..74d1021f6236d5b8519b6c81d674ec497ddc0630 100644 (file)
@@ -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<A: Anchor> Anchor for &A {
     fn anchor_block(&self) -> BlockId {
         <A as Anchor>::anchor_block(self)
     }
@@ -112,13 +112,13 @@ pub struct TxPosInBlock<'b> {
     pub tx_pos: usize,
 }
 
-impl<'b> From<TxPosInBlock<'b>> for BlockId {
+impl From<TxPosInBlock<'_>> for BlockId {
     fn from(pos: TxPosInBlock) -> Self {
         pos.block_id
     }
 }
 
-impl<'b> From<TxPosInBlock<'b>> for ConfirmationBlockTime {
+impl From<TxPosInBlock<'_>> for ConfirmationBlockTime {
     fn from(pos: TxPosInBlock) -> Self {
         Self {
             block_id: pos.block_id,
index 0207f242e14aad722ad53ead0213dcda5c6f4344..2d512cfeaea5e197232b32c10e0e7312eb2b17d8 100644 (file)
@@ -183,7 +183,7 @@ pub struct TxNode<'a, T, A> {
     pub last_seen_unconfirmed: Option<u64>,
 }
 
-impl<'a, T, A> Deref for TxNode<'a, T, A> {
+impl<T, A> 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<A, F, O> Iterator for TxAncestors<'_, A, F, O>
 where
     F: FnMut(usize, Arc<Transaction>) -> Option<O>,
 {
@@ -1470,7 +1470,7 @@ where
     }
 }
 
-impl<'g, A, F, O> Iterator for TxDescendants<'g, A, F, O>
+impl<A, F, O> Iterator for TxDescendants<'_, A, F, O>
 where
     F: FnMut(usize, Txid) -> Option<O>,
 {
index e8515c868738c98372e20c5a1c186462606352f9..a0b8220eeb0fcd1a5f18be3718e67fe4f9851eb5 100644 (file)
@@ -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,
index eee4a5371ee8e0c2f0365f6d3bf69f84da5db342..a5ec813c97a93df680ef8f1930385df9f72c8c7e 100644 (file)
@@ -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<I: core::fmt::Debug + core::any::Any> 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<InspectFullScan<K>>,
 }
 
-impl<'r, K: Ord + Clone> Iterator for KeychainSpkIter<'r, K> {
+impl<K: Ord + Clone> Iterator for KeychainSpkIter<'_, K> {
     type Item = Indexed<ScriptBuf>;
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -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<I> Iterator for SyncIter<'_, I, ScriptBuf> {
     type Item = ScriptBuf;
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -524,7 +524,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, ScriptBuf> {
     }
 }
 
-impl<'r, I> Iterator for SyncIter<'r, I, Txid> {
+impl<I> Iterator for SyncIter<'_, I, Txid> {
     type Item = Txid;
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -537,7 +537,7 @@ impl<'r, I> Iterator for SyncIter<'r, I, Txid> {
     }
 }
 
-impl<'r, I> Iterator for SyncIter<'r, I, OutPoint> {
+impl<I> Iterator for SyncIter<'_, I, OutPoint> {
     type Item = OutPoint;
 
     fn next(&mut self) -> Option<Self::Item> {
index 6be3fd03458ce2edcf75ace07b1b0234573ad0aa..ad34c77ded7aff33366512d8e740f11b39aa1150 100644 (file)
@@ -33,7 +33,7 @@ impl<'t, T> EntryIter<'t, T> {
     }
 }
 
-impl<'t, T> Iterator for EntryIter<'t, T>
+impl<T> Iterator for EntryIter<'_, T>
 where
     T: serde::de::DeserializeOwned,
 {
@@ -71,7 +71,7 @@ where
     }
 }
 
-impl<'t, T> Drop for EntryIter<'t, T> {
+impl<T> 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.
index abf4cac4396bf7d9443a6fcc604c10554b566201..2c0f15f643160d6774d12b5d6c0ac1043986b3d4 100644 (file)
@@ -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 {
index c3dd95da8988e8ef4a1e83f7a1d166d442107111..1d3b375fc27441b0d621c69044567407077e5d11 100644 (file)
@@ -145,9 +145,7 @@ impl IntoWalletDescriptor for (ExtendedDescriptor, KeyMap) {
             network: Network,
         }
 
-        impl<'s, 'd> miniscript::Translator<DescriptorPublicKey, String, DescriptorError>
-            for Translator<'s, 'd>
-        {
+        impl miniscript::Translator<DescriptorPublicKey, String, DescriptorError> for Translator<'_, '_> {
             fn pk(&mut self, pk: &DescriptorPublicKey) -> Result<String, DescriptorError> {
                 let secp = &self.secp;
 
index a8876e8e4dc0e036e0f6718a3f3d654e2c076673..d07c72712f2ea942a7d1b48bf23a3a17b49f9ccc 100644 (file)
@@ -254,7 +254,7 @@ impl<P: AsyncWalletPersister> PersistedWallet<P> {
 }
 
 #[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<ChangeSet, Self::Error> {
index 3eea1eb3ac1996e0d21641ce93007730e905919e..868d51dfacc6d2f11af7909d381d26d4a9b87621 100644 (file)
@@ -644,7 +644,7 @@ impl<'a, Cs> TxBuilder<'a, Cs> {
     }
 }
 
-impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs> {
+impl<Cs: CoinSelectionAlgorithm> TxBuilder<'_, Cs> {
     /// Finish building the transaction.
     ///
     /// Uses the thread-local random number generator (rng).