Skip to content

Commit d504c51

Browse files
committed
Add elided lifetime
clippy emits: warning: hiding a lifetime that's elided elsewhere is confusing As suggested add the elided lifetime.
1 parent 4e8f91b commit d504c51

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

bitcoin/src/base58.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ impl<T: Default + Copy> SmallVec<T> {
205205
}
206206
}
207207

208-
fn iter(&self) -> iter::Chain<slice::Iter<T>, slice::Iter<T>> {
208+
fn iter(&self) -> iter::Chain<slice::Iter<'_, T>, slice::Iter<'_, T>> {
209209
// If len<100 then we just append an empty vec
210210
self.stack[0..self.len].iter().chain(self.heap.iter())
211211
}
212212

213-
fn iter_mut(&mut self) -> iter::Chain<slice::IterMut<T>, slice::IterMut<T>> {
213+
fn iter_mut(&mut self) -> iter::Chain<slice::IterMut<'_, T>, slice::IterMut<'_, T>> {
214214
// If len<100 then we just append an empty vec
215215
self.stack[0..self.len].iter_mut().chain(self.heap.iter_mut())
216216
}

bitcoin/src/bip32.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,17 @@ impl DerivationPath {
377377

378378
/// Get an [Iterator] over the children of this [DerivationPath]
379379
/// starting with the given [ChildNumber].
380-
pub fn children_from(&self, cn: ChildNumber) -> DerivationPathIterator {
380+
pub fn children_from(&self, cn: ChildNumber) -> DerivationPathIterator<'_> {
381381
DerivationPathIterator::start_from(self, cn)
382382
}
383383

384384
/// Get an [Iterator] over the unhardened children of this [DerivationPath].
385-
pub fn normal_children(&self) -> DerivationPathIterator {
385+
pub fn normal_children(&self) -> DerivationPathIterator<'_> {
386386
DerivationPathIterator::start_from(self, ChildNumber::Normal { index: 0 })
387387
}
388388

389389
/// Get an [Iterator] over the hardened children of this [DerivationPath].
390-
pub fn hardened_children(&self) -> DerivationPathIterator {
390+
pub fn hardened_children(&self) -> DerivationPathIterator<'_> {
391391
DerivationPathIterator::start_from(self, ChildNumber::Hardened { index: 0 })
392392
}
393393

bitcoin/src/blockdata/script/borrowed.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl Script {
346346
///
347347
/// To force minimal pushes, use [`instructions_minimal`](Self::instructions_minimal).
348348
#[inline]
349-
pub fn instructions(&self) -> Instructions {
349+
pub fn instructions(&self) -> Instructions<'_> {
350350
Instructions {
351351
data: self.0.iter(),
352352
enforce_minimal: false,
@@ -358,7 +358,7 @@ impl Script {
358358
/// This is similar to [`instructions`](Self::instructions) but an error is returned if a push
359359
/// is not minimal.
360360
#[inline]
361-
pub fn instructions_minimal(&self) -> Instructions {
361+
pub fn instructions_minimal(&self) -> Instructions<'_> {
362362
Instructions {
363363
data: self.0.iter(),
364364
enforce_minimal: true,
@@ -373,7 +373,7 @@ impl Script {
373373
///
374374
/// To force minimal pushes, use [`Self::instruction_indices_minimal`].
375375
#[inline]
376-
pub fn instruction_indices(&self) -> InstructionIndices {
376+
pub fn instruction_indices(&self) -> InstructionIndices<'_> {
377377
InstructionIndices::from_instructions(self.instructions())
378378
}
379379

@@ -382,7 +382,7 @@ impl Script {
382382
/// This is similar to [`instruction_indices`](Self::instruction_indices) but an error is
383383
/// returned if a push is not minimal.
384384
#[inline]
385-
pub fn instruction_indices_minimal(&self) -> InstructionIndices {
385+
pub fn instruction_indices_minimal(&self) -> InstructionIndices<'_> {
386386
InstructionIndices::from_instructions(self.instructions_minimal())
387387
}
388388

bitcoin/src/blockdata/witness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl Witness {
215215
}
216216

217217
/// Returns a struct implementing [`Iterator`].
218-
pub fn iter(&self) -> Iter {
218+
pub fn iter(&self) -> Iter<'_> {
219219
Iter {
220220
inner: self.content.as_slice(),
221221
indices_start: self.indices_start,

bitcoin/src/taproot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ impl TapTree {
690690

691691
/// Returns [`TapTreeIter<'_>`] iterator for a taproot script tree, operating in DFS order over
692692
/// tree [`ScriptLeaf`]s.
693-
pub fn script_leaves(&self) -> ScriptLeaves { ScriptLeaves { leaf_iter: self.0.leaf_nodes() } }
693+
pub fn script_leaves(&self) -> ScriptLeaves<'_> { ScriptLeaves { leaf_iter: self.0.leaf_nodes() } }
694694
}
695695

696696
impl TryFrom<TaprootBuilder> for TapTree {
@@ -839,7 +839,7 @@ impl NodeInfo {
839839
}
840840

841841
/// Creates an iterator over all leaves (including hidden leaves) in the tree.
842-
pub fn leaf_nodes(&self) -> LeafNodes { LeafNodes { leaf_iter: self.leaves.iter() } }
842+
pub fn leaf_nodes(&self) -> LeafNodes<'_> { LeafNodes { leaf_iter: self.leaves.iter() } }
843843
}
844844

845845
impl TryFrom<TaprootBuilder> for NodeInfo {

0 commit comments

Comments
 (0)