Skip to content

Commit

Permalink
ci(clippy): fix new stricter needless_lifetime errors for rust 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory committed Dec 16, 2024
1 parent 2586e1e commit 941bca0
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 20 deletions.
6 changes: 3 additions & 3 deletions crates/chain/src/tx_data_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions crates/chain/src/tx_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>,
{
Expand Down Expand Up @@ -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>,
{
Expand Down
2 changes: 1 addition & 1 deletion crates/chain/tests/test_local_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions crates/core/src/spk_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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> {
Expand All @@ -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> {
Expand All @@ -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> {
Expand All @@ -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> {
Expand Down
4 changes: 2 additions & 2 deletions crates/file_store/src/entry_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/testenv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions crates/wallet/src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/persisted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 941bca0

Please sign in to comment.