Skip to content

Commit

Permalink
ci: clippy: remove a ton of now-elidable lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Oct 10, 2024
1 parent dd3396e commit 86305f0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/descriptor/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<'f, 'a> Formatter<'f, 'a> {
}
}

impl<'f, 'a> fmt::Write for Formatter<'f, 'a> {
impl fmt::Write for Formatter<'_, '_> {
fn write_str(&mut self, s: &str) -> fmt::Result {
self.fmt.write_str(s)?;
self.eng.input(s).map_err(|_| fmt::Error)
Expand Down
6 changes: 3 additions & 3 deletions src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ impl Descriptor<DescriptorPublicKey> {

struct KeyMapWrapper<'a, C: secp256k1::Signing>(KeyMap, &'a secp256k1::Secp256k1<C>);

impl<'a, C: secp256k1::Signing> Translator<String> for KeyMapWrapper<'a, C> {
impl<C: secp256k1::Signing> Translator<String> for KeyMapWrapper<'_, C> {
type TargetPk = DescriptorPublicKey;
type Error = Error;

Expand Down Expand Up @@ -778,7 +778,7 @@ impl Descriptor<DescriptorPublicKey> {
pub fn to_string_with_secret(&self, key_map: &KeyMap) -> String {
struct KeyMapLookUp<'a>(&'a KeyMap);

impl<'a> Translator<DescriptorPublicKey> for KeyMapLookUp<'a> {
impl Translator<DescriptorPublicKey> for KeyMapLookUp<'_> {
type TargetPk = String;
type Error = core::convert::Infallible;

Expand Down Expand Up @@ -941,7 +941,7 @@ impl Descriptor<DefiniteDescriptorKey> {
) -> Result<Descriptor<bitcoin::PublicKey>, ConversionError> {
struct Derivator<'a, C: secp256k1::Verification>(&'a secp256k1::Secp256k1<C>);

impl<'a, C: secp256k1::Verification> Translator<DefiniteDescriptorKey> for Derivator<'a, C> {
impl<C: secp256k1::Verification> Translator<DefiniteDescriptorKey> for Derivator<'_, C> {
type TargetPk = bitcoin::PublicKey;
type Error = ConversionError;

Expand Down
2 changes: 1 addition & 1 deletion src/descriptor/tr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub struct TapTreeIter<'a, Pk: MiniscriptKey> {
stack: Vec<(u8, &'a TapTree<Pk>)>,
}

impl<'a, Pk: MiniscriptKey> TapTreeIter<'a, Pk> {
impl<Pk: MiniscriptKey> TapTreeIter<'_, Pk> {
/// Helper function to return an empty iterator from Descriptor::tap_tree_iter.
pub(super) fn empty() -> Self { Self { stack: vec![] } }
}
Expand Down
2 changes: 1 addition & 1 deletion src/miniscript/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> PkIter<'a, Pk, Ctx> {
}
}

impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkIter<'a, Pk, Ctx> {
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkIter<'_, Pk, Ctx> {
type Item = Pk;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/miniscript/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Token<'s> {
Bytes65(&'s [u8]),
}

impl<'s> fmt::Display for Token<'s> {
impl fmt::Display for Token<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Token::Num(n) => write!(f, "#{}", n),
Expand Down
4 changes: 2 additions & 2 deletions src/miniscript/satisfy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl_satisfier_for_map_hash_tapleafhash_to_key_taproot_sig! {
impl Satisfier<Pk> for HashMap<(hash160::Hash, TapLeafHash), (Pk, bitcoin::taproot::Signature)>
}

impl<'a, Pk: MiniscriptKey + ToPublicKey, S: Satisfier<Pk>> Satisfier<Pk> for &'a S {
impl<Pk: MiniscriptKey + ToPublicKey, S: Satisfier<Pk>> Satisfier<Pk> for &S {
fn lookup_ecdsa_sig(&self, p: &Pk) -> Option<bitcoin::ecdsa::Signature> {
(**self).lookup_ecdsa_sig(p)
}
Expand Down Expand Up @@ -322,7 +322,7 @@ impl<'a, Pk: MiniscriptKey + ToPublicKey, S: Satisfier<Pk>> Satisfier<Pk> for &'
fn check_after(&self, n: absolute::LockTime) -> bool { (**self).check_after(n) }
}

impl<'a, Pk: MiniscriptKey + ToPublicKey, S: Satisfier<Pk>> Satisfier<Pk> for &'a mut S {
impl<Pk: MiniscriptKey + ToPublicKey, S: Satisfier<Pk>> Satisfier<Pk> for &mut S {
fn lookup_ecdsa_sig(&self, p: &Pk) -> Option<bitcoin::ecdsa::Signature> {
(**self).lookup_ecdsa_sig(p)
}
Expand Down
2 changes: 1 addition & 1 deletion src/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ macro_rules! impl_log_method {
}

#[cfg(feature = "std")]
impl<'a> AssetProvider<DefiniteDescriptorKey> for LoggerAssetProvider<'a> {
impl AssetProvider<DefiniteDescriptorKey> for LoggerAssetProvider<'_> {
impl_log_method!(provider_lookup_ecdsa_sig, pk: &DefiniteDescriptorKey, -> bool);
impl_log_method!(provider_lookup_tap_key_spend_sig, pk: &DefiniteDescriptorKey, -> Option<usize>);
impl_log_method!(provider_lookup_tap_leaf_script_sig, pk: &DefiniteDescriptorKey, leaf_hash: &TapLeafHash, -> Option<usize>);
Expand Down
4 changes: 2 additions & 2 deletions src/primitives/threshold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ struct ThreshDisplay<'t, 's, T, const MAX: usize> {
show_k: bool,
}

impl<'t, 's, T, const MAX: usize> fmt::Display for ThreshDisplay<'t, 's, T, MAX>
impl<T, const MAX: usize> fmt::Display for ThreshDisplay<'_, '_, T, MAX>
where
T: fmt::Display,
{
Expand All @@ -286,7 +286,7 @@ where
}
}

impl<'t, 's, T, const MAX: usize> fmt::Debug for ThreshDisplay<'t, 's, T, MAX>
impl<T, const MAX: usize> fmt::Debug for ThreshDisplay<'_, '_, T, MAX>
where
T: fmt::Debug,
{
Expand Down
2 changes: 1 addition & 1 deletion src/psbt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl<'psbt> PsbtInputSatisfier<'psbt> {
pub fn new(psbt: &'psbt Psbt, index: usize) -> Self { Self { psbt, index } }
}

impl<'psbt, Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for PsbtInputSatisfier<'psbt> {
impl<Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for PsbtInputSatisfier<'_> {
fn lookup_tap_key_spend_sig(&self) -> Option<bitcoin::taproot::Signature> {
self.psbt.inputs[self.index].tap_key_sig
}
Expand Down

0 comments on commit 86305f0

Please sign in to comment.