What changed, and why it matters
This commit only fixes minor grammar and wording in code documentation comments. It adds missing articles like 'the', standardizes how an error type is described, and changes a verb to third person. There are no code behavior changes, no bug fixes, and no security implications.
No action needed. This is a non-functional documentation cleanup commit with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff consists entirely of documentation comment edits across three files in the primitives crate: adding ‘the’ to WitnessScript and Script hash docstrings, rewording the OutPointDecoderError doc comment to match other decoder errors, and changing ‘Cast’ to ‘Casts’ in the cast_to_usize_if_valid doc comment. No executable code, signatures, types, logic, or APIs were modified.
Changed components
primitives/src/script/borrowed.rsprimitives/src/transaction.rsprimitives/src/witness.rsInspect captured patch +4 / −4
### primitives/src/script/borrowed.rs
@@ -312,7 +312,7 @@ impl ScriptPubKey {
}
impl WitnessScript {
- /// Returns 256-bit hash of the script for P2WSH outputs.
+ /// Returns the 256-bit hash of the script for P2WSH outputs.
///
/// # Errors
///
@@ -324,7 +324,7 @@ impl WitnessScript {
}
impl<T: ScriptHashableTag> Script<T> {
- /// Returns 160-bit hash of the script for P2SH outputs.
+ /// Returns the 160-bit hash of the script for P2SH outputs.
///
/// # Errors
///
### primitives/src/transaction.rs
@@ -1540,7 +1540,7 @@ pub mod error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { Some(&self.0) }
}
- /// Error while decoding an [`OutPoint`].
+ /// An error consensus decoding an [`OutPoint`].
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct OutPointDecoderError(pub(super) encoding::UnexpectedEofError);
### primitives/src/witness.rs
@@ -932,7 +932,7 @@ impl<'a> Arbitrary<'a> for Witness {
}
}
-/// Cast a decoded length prefix to a `usize`.
+/// Casts a decoded length prefix to a `usize`.
///
/// This function is basically just defensive. For all sane use cases the length prefix should be
/// less than `MAX_VEC_SIZE` (on a 32-bit machine). If the value is bigger that `u16::MAX` and weWhy 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.