p2p: Fix types and wording for decoder errors
What changed, and why it matters
This commit fixes four doc comments in the P2P networking code. The comments previously referred to the wrong type names (the decoder error structs themselves) and used incorrect 'a/an' grammar. There is no code behavior change, only documentation wording corrections.
No security action needed; this is a documentation-only cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates Rust doc comments for AddressDecoderError, V1MessageHeaderDecoderError, PingDecoderError, and PongDecoderError so they describe the decoded result type (Address, V1MessageHeader, Ping, Pong) rather than the error wrapper type, and adjusts articles from ‘a’ to ‘an’ where appropriate. No executable code, type signatures, or logic were modified.
Changed components
p2p/src/address.rsp2p/src/message.rsInspect captured patch +4 / −4
diff --git a/p2p/src/address.rs b/p2p/src/address.rs
index e8947d24..1e03c450 100644
--- a/p2p/src/address.rs
+++ b/p2p/src/address.rs
@@ -230,7 +230,7 @@ impl encoding::Decodable for Address {
}
}
-/// An error consensus decoding a [`AddressDecoderError`].
+/// An error consensus decoding an [`Address`].
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AddressDecoderError(<AddressInnerDecoder as encoding::Decoder>::Error);
diff --git a/p2p/src/message.rs b/p2p/src/message.rs
index 31818099..def586ce 100644
--- a/p2p/src/message.rs
+++ b/p2p/src/message.rs
@@ -366,7 +366,7 @@ impl encoding::Decodable for V1MessageHeader {
}
}
-/// An error consensus decoding a [`V1MessageHeaderDecoderError`].
+/// An error consensus decoding a [`V1MessageHeader`].
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct V1MessageHeaderDecoderError(<V1MessageHeaderInnerDecoder as encoding::Decoder>::Error);
@@ -794,7 +794,7 @@ impl encoding::Decodable for Ping {
fn decoder() -> Self::Decoder { PingDecoder(encoding::ArrayDecoder::<8>::new()) }
}
-/// An error consensus decoding a [`PingDecoderError`].
+/// An error consensus decoding a [`Ping`].
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PingDecoderError(<encoding::ArrayDecoder<8> as encoding::Decoder>::Error);
@@ -870,7 +870,7 @@ impl encoding::Decodable for Pong {
fn decoder() -> Self::Decoder { PongDecoder(encoding::ArrayDecoder::<8>::new()) }
}
-/// An error consensus decoding a [`PongDecoderError`].
+/// An error consensus decoding a [`Pong`].
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PongDecoderError(<encoding::ArrayDecoder<8> as encoding::Decoder>::Error);
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.