What changed, and why it matters
This commit only cleans up Rust code style by replacing explicit lifetime names with a shorthand. It does not change what the code does, how it handles data, or any security behavior. There is no security issue here.
No security action needed. This is a routine code-quality/style cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit addresses Clippy warnings about explicit lifetimes that can be inferred (e.g., impl<'de> serde::de::Visitor<'de> for Visitor becomes impl serde::de::Visitor<'_> for Visitor). These are purely syntactic changes using Rust’s anonymous lifetime shorthand. The generated code semantics, borrow checking, and runtime behavior are unchanged.
Changed components
bitcoin/src/psbt/mod.rsconsensus_encoding/src/encode/encoders.rsprimitives/src/transaction.rsprimitives/src/witness.rsInspect captured patch +5 / −5
diff --git a/bitcoin/src/psbt/mod.rs b/bitcoin/src/psbt/mod.rs
index e44c66a0..b28ae4c1 100644
--- a/bitcoin/src/psbt/mod.rs
+++ b/bitcoin/src/psbt/mod.rs
@@ -753,7 +753,7 @@ impl<'de> serde::Deserialize<'de> for Psbt {
{
struct Visitor;
- impl<'de> serde::de::Visitor<'de> for Visitor {
+ impl serde::de::Visitor<'_> for Visitor {
type Value = Psbt;
fn expecting(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
diff --git a/consensus_encoding/src/encode/encoders.rs b/consensus_encoding/src/encode/encoders.rs
index 16003b39..e971e2f8 100644
--- a/consensus_encoding/src/encode/encoders.rs
+++ b/consensus_encoding/src/encode/encoders.rs
@@ -277,7 +277,7 @@ mod tests {
struct TestBytes<'a>(&'a [u8], bool);
- impl<'a> Encodable for TestBytes<'a> {
+ impl Encodable for TestBytes<'_> {
type Encoder<'s>
= BytesEncoder<'s>
where
diff --git a/primitives/src/transaction.rs b/primitives/src/transaction.rs
index 89b79b92..1a1882a0 100644
--- a/primitives/src/transaction.rs
+++ b/primitives/src/transaction.rs
@@ -431,7 +431,7 @@ impl<'e> WitnessesEncoder<'e> {
}
#[cfg(feature = "alloc")]
-impl<'e> Encoder for WitnessesEncoder<'e> {
+impl Encoder for WitnessesEncoder<'_> {
#[inline]
fn current_chunk(&self) -> Option<&[u8]> {
// `advance` sets `cur_enc` to `None` once the slice encoder is completely exhausted.
@@ -628,7 +628,7 @@ impl<'de> Deserialize<'de> for OutPoint {
if deserializer.is_human_readable() {
struct StringVisitor;
- impl<'de> de::Visitor<'de> for StringVisitor {
+ impl de::Visitor<'_> for StringVisitor {
type Value = OutPoint;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
diff --git a/primitives/src/witness.rs b/primitives/src/witness.rs
index b7e87924..00446eb2 100644
--- a/primitives/src/witness.rs
+++ b/primitives/src/witness.rs
@@ -279,7 +279,7 @@ impl Encodable for Witness {
}
}
-impl<'a> Encoder for WitnessEncoder<'a> {
+impl Encoder for WitnessEncoder<'_> {
#[inline]
fn current_chunk(&self) -> Option<&[u8]> { self.0.current_chunk() }
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.