consensus_encoding: Fix clippy lifetime warnings
What changed, and why it matters
This commit only cleans up Rust compiler/clippy warnings about lifetime syntax. It changes how lifetimes are written in two places but does not alter what the code actually does. There is no security issue here.
No action needed. This is a routine lint/style fix with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch replaces explicit named lifetime parameters ('e, 'sl) with anonymous '_ placeholders in impl Encoder blocks for BytesEncoder and ArrayEncoder. This is a cosmetic change to satisfy clippy’s lifetime elision suggestions. The generated behavior and trait bounds are unchanged.
Changed components
consensus_encoding/src/encode/encoders.rsInspect captured patch +2 / −2
diff --git a/consensus_encoding/src/encode/encoders.rs b/consensus_encoding/src/encode/encoders.rs
index 1ddcec94..ab88f82c 100644
--- a/consensus_encoding/src/encode/encoders.rs
+++ b/consensus_encoding/src/encode/encoders.rs
@@ -37,7 +37,7 @@ impl<'sl> BytesEncoder<'sl> {
}
}
-impl<'e, 'sl> Encoder<'e> for BytesEncoder<'sl> {
+impl Encoder<'_> for BytesEncoder<'_> {
fn current_chunk(&self) -> Option<&[u8]> {
if let Some(compact_size) = self.compact_size.as_ref() {
Some(compact_size)
@@ -67,7 +67,7 @@ impl<const N: usize> ArrayEncoder<N> {
pub fn without_length_prefix(arr: [u8; N]) -> Self { Self { arr: Some(arr) } }
}
-impl<'e, const N: usize> Encoder<'e> for ArrayEncoder<N> {
+impl<const N: usize> Encoder<'_> for ArrayEncoder<N> {
fn current_chunk(&self) -> Option<&[u8]> { self.arr.as_ref().map(|x| &x[..]) }
fn advance(&mut self) -> bool {
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.