fix: correct typos and clarify comments and tests
What changed, and why it matters
This commit fixes three minor typos: one grammar correction in a code comment about SegWit transaction parsing, one grammar correction in a documentation comment about a feature flag, and one typo ('crate' to 'create') in an error message inside a test. There are no code behavior changes.
No security action needed. Treat as a normal documentation/test-quality commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is purely cosmetic. It changes ‘be encoded’ to ‘to be encoded’ in a comment, ‘features is enabled’ to ‘feature is enabled’ in a doc comment, and ‘crate’ to ‘create’ in a panic message within a unit test. No executable logic, parsing rules, serialization, or APIs are modified.
Changed components
primitives/src/transaction.rs (comment only)primitives/src/witness.rs (doc comment only)units/src/amount/tests.rs (test panic message only)Inspect captured patch +3 / −3
diff --git a/primitives/src/transaction.rs b/primitives/src/transaction.rs
index a07608a2..445544b1 100644
--- a/primitives/src/transaction.rs
+++ b/primitives/src/transaction.rs
@@ -74,7 +74,7 @@ use crate::witness::Witness;
///
/// However, in protocols where transactions may legitimately have 0 inputs, e.g.
/// when parties are cooperatively funding a transaction, the "00 means SegWit"
-/// heuristic does not work. Since SegWit requires such a transaction be encoded
+/// heuristic does not work. Since SegWit requires such a transaction to be encoded
/// in the original transaction format (since it has no inputs and therefore
/// no input witnesses), a traditionally encoded transaction may have the `0001`
/// SegWit flag in it, which confuses most SegWit parsers including the one in
diff --git a/primitives/src/witness.rs b/primitives/src/witness.rs
index 02f9c7a7..c8623068 100644
--- a/primitives/src/witness.rs
+++ b/primitives/src/witness.rs
@@ -334,7 +334,7 @@ impl<T: core::borrow::Borrow<[u8]>> PartialEq<Witness> for alloc::sync::Arc<[T]>
/// Debug implementation that displays the witness as a structured output containing:
/// - Number of witness elements
/// - Total bytes across all elements
-/// - List of hex-encoded witness elements if `hex` features is enabled.
+/// - List of hex-encoded witness elements if `hex` feature is enabled.
#[allow(clippy::missing_fields_in_debug)] // We don't want to show `indices_start`.
impl fmt::Debug for Witness {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
diff --git a/units/src/amount/tests.rs b/units/src/amount/tests.rs
index bcfa7354..817cd17c 100644
--- a/units/src/amount/tests.rs
+++ b/units/src/amount/tests.rs
@@ -86,7 +86,7 @@ fn from_str_zero() {
Ok(_) => panic!("unsigned amount from {}", s),
}
match s.parse::<SignedAmount>() {
- Err(e) => panic!("failed to crate amount from {}: {:?}", s, e),
+ Err(e) => panic!("failed to create amount from {}: {:?}", s, e),
Ok(amount) => assert_eq!(amount, SignedAmount::ZERO),
}
}
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.