p2p: change `CommandStringError` visibility modifier
What changed, and why it matters
This commit narrows the visibility of an internal field inside an error type from public to crate-internal. It is a routine API-cleanup change with no security relevance.
No security action required. Treat as a normal API-hygiene change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes CommandStringError(pub alloc::string::String) to CommandStringError(pub(super) alloc::string::String), making the wrapped string field accessible only within the p2p crate rather than to all downstream consumers. This is a visibility/API-encapsulation refactor; it does not alter parsing, validation, serialization, or error handling logic.
Changed components
p2p/src/message.rs error moduleCommandStringError typeInspect captured patch +1 / −1
diff --git a/p2p/src/message.rs b/p2p/src/message.rs
index 8bf6ac0d..7efd5d6a 100644
--- a/p2p/src/message.rs
+++ b/p2p/src/message.rs
@@ -1891,7 +1891,7 @@ pub mod error {
/// This is currently returned for command strings longer than 12.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
- pub struct CommandStringError(pub alloc::string::String);
+ pub struct CommandStringError(pub(super) alloc::string::String);
impl fmt::Display for CommandStringError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
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.