Skip to content

Commit a5c477b

Browse files
committed
clippy: fix all nightly lints
The lifetime stuff in particular has been blocking rust-bitcoin#805 every week for several months now.
1 parent 2ca5a35 commit a5c477b

File tree

9 files changed

+10
-12
lines changed

9 files changed

+10
-12
lines changed

src/descriptor/key.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,9 +1203,7 @@ impl<K: InnerXKey> DescriptorXKey<K> {
12031203
};
12041204

12051205
if &compare_fingerprint == fingerprint
1206-
&& compare_path
1207-
.into_iter()
1208-
.eq(path_excluding_wildcard.into_iter())
1206+
&& compare_path.into_iter().eq(&path_excluding_wildcard)
12091207
{
12101208
Some(path_excluding_wildcard)
12111209
} else {

src/descriptor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
294294
///
295295
/// If the descriptor is not a Taproot descriptor, **or** if the descriptor is a
296296
/// Taproot descriptor containing only a keyspend, returns an empty iterator.
297-
pub fn tap_tree_iter(&self) -> tr::TapTreeIter<Pk> {
297+
pub fn tap_tree_iter(&self) -> tr::TapTreeIter<'_, Pk> {
298298
if let Descriptor::Tr(ref tr) = self {
299299
if let Some(tree) = tr.tap_tree() {
300300
return tree.leaves();

src/descriptor/tr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<Pk: MiniscriptKey> Tr<Pk> {
108108
///
109109
/// The yielded elements include the Miniscript for each leave as well as its depth
110110
/// in the tree, which is the data required by PSBT (BIP 371).
111-
pub fn leaves(&self) -> TapTreeIter<Pk> {
111+
pub fn leaves(&self) -> TapTreeIter<'_, Pk> {
112112
match self.tree {
113113
Some(ref t) => t.leaves(),
114114
None => TapTreeIter::empty(),

src/descriptor/tr/spend_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<Pk: ToPublicKey> TrSpendInfo<Pk> {
181181
/// This yields the same leaves in the same order as [`super::Tr::leaves`] on the original
182182
/// [`super::Tr`]. However, in addition to yielding the leaves and their depths, it also
183183
/// yields their scripts, leafhashes, and control blocks.
184-
pub fn leaves(&self) -> TrSpendInfoIter<Pk> {
184+
pub fn leaves(&self) -> TrSpendInfoIter<'_, Pk> {
185185
TrSpendInfoIter {
186186
spend_info: self,
187187
index: 0,

src/descriptor/tr/taptree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<Pk: MiniscriptKey> TapTree<Pk> {
5353
///
5454
/// The yielded elements include the Miniscript for each leave as well as its depth
5555
/// in the tree, which is the data required by PSBT (BIP 371).
56-
pub fn leaves(&self) -> TapTreeIter<Pk> { TapTreeIter::from_tree(self) }
56+
pub fn leaves(&self) -> TapTreeIter<'_, Pk> { TapTreeIter::from_tree(self) }
5757

5858
/// Converts keys from one type of public key to another.
5959
pub fn translate_pk<T>(

src/miniscript/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
1818
/// Creates a new [Iter] iterator that will iterate over all [Miniscript] items within
1919
/// AST by traversing its branches. For the specific algorithm please see
2020
/// [Iter::next] function.
21-
pub fn iter(&self) -> Iter<Pk, Ctx> { Iter::new(self) }
21+
pub fn iter(&self) -> Iter<'_, Pk, Ctx> { Iter::new(self) }
2222

2323
/// Creates a new [PkIter] iterator that will iterate over all plain public keys (and not
2424
/// key hash values) present in [Miniscript] items within AST by traversing all its branches.
2525
/// For the specific algorithm please see [PkIter::next] function.
26-
pub fn iter_pk(&self) -> PkIter<Pk, Ctx> { PkIter::new(self) }
26+
pub fn iter_pk(&self) -> PkIter<'_, Pk, Ctx> { PkIter::new(self) }
2727

2828
/// Enumerates all child nodes of the current AST node (`self`) and returns a `Vec` referencing
2929
/// them.

src/miniscript/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ impl<Ctx: ScriptContext> Miniscript<Ctx::Key, Ctx> {
604604
/// The type information and extra properties are implied by the AST.
605605
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialOrd for Miniscript<Pk, Ctx> {
606606
fn partial_cmp(&self, other: &Miniscript<Pk, Ctx>) -> Option<cmp::Ordering> {
607-
Some(self.node.cmp(&other.node))
607+
Some(self.cmp(other))
608608
}
609609
}
610610

src/policy/concrete.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
192192
/// Since this splitting might lead to exponential blow-up, we constrain the number of
193193
/// leaf-nodes to [`MAX_COMPILATION_LEAVES`].
194194
#[cfg(feature = "compiler")]
195-
fn tapleaf_probability_iter(&self) -> TapleafProbabilityIter<Pk> {
195+
fn tapleaf_probability_iter(&self) -> TapleafProbabilityIter<'_, Pk> {
196196
TapleafProbabilityIter { stack: vec![(1.0, self)] }
197197
}
198198

src/primitives/threshold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<T, const MAX: usize> Threshold<T, MAX> {
217217
pub fn into_data(self) -> Vec<T> { self.inner }
218218

219219
/// Passthrough to an iterator on the underlying vector.
220-
pub fn iter(&self) -> core::slice::Iter<T> { self.inner.iter() }
220+
pub fn iter(&self) -> core::slice::Iter<'_, T> { self.inner.iter() }
221221
}
222222

223223
impl<T> Threshold<T, 0> {

0 commit comments

Comments
 (0)