Skip to content

Commit 8944ca0

Browse files
committed
Remove explicit lifetimes
Clippy emits: warning: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) As suggested, remove explicit lifetimes and use `'_`,
1 parent 5647e29 commit 8944ca0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/interpreter/inner.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ fn pk_from_slice(slice: &[u8], require_compressed: bool) -> Result<bitcoin::Publ
3737
}
3838
}
3939

40-
fn pk_from_stackelem<'a>(
41-
elem: &stack::Element<'a>,
40+
fn pk_from_stackelem(
41+
elem: &stack::Element<'_>,
4242
require_compressed: bool,
4343
) -> Result<bitcoin::PublicKey, Error> {
4444
let slice = if let stack::Element::Push(slice) = *elem {
@@ -51,8 +51,8 @@ fn pk_from_stackelem<'a>(
5151

5252
// Parse the script with appropriate context to check for context errors like
5353
// correct usage of x-only keys or multi_a
54-
fn script_from_stackelem<'a, Ctx: ScriptContext>(
55-
elem: &stack::Element<'a>,
54+
fn script_from_stackelem<Ctx: ScriptContext>(
55+
elem: &stack::Element<'_>,
5656
) -> Result<Miniscript<Ctx::Key, Ctx>, Error> {
5757
match *elem {
5858
stack::Element::Push(sl) => {

src/miniscript/lex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'s> Iterator for TokenIter<'s> {
113113
}
114114

115115
/// Tokenize a script
116-
pub fn lex<'s>(script: &'s script::Script) -> Result<Vec<Token<'s>>, Error> {
116+
pub fn lex(script: &'_ script::Script) -> Result<Vec<Token<'_>>, Error> {
117117
let mut ret = Vec::with_capacity(script.len());
118118

119119
for ins in script.instructions_minimal() {

src/psbt/finalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub(super) fn get_utxo(psbt: &Psbt, index: usize) -> Result<&bitcoin::TxOut, Inp
117117
}
118118

119119
/// Get the Prevouts for the psbt
120-
pub(super) fn prevouts<'a>(psbt: &'a Psbt) -> Result<Vec<&bitcoin::TxOut>, super::Error> {
120+
pub(super) fn prevouts(psbt: &Psbt) -> Result<Vec<&bitcoin::TxOut>, super::Error> {
121121
let mut utxos = vec![];
122122
for i in 0..psbt.inputs.len() {
123123
let utxo_ref = get_utxo(psbt, i).map_err(|e| Error::InputError(e, i))?;

0 commit comments

Comments
 (0)