consensus_encoding: Adjust docs spelling and grammar
What changed, and why it matters
This commit only fixes spelling and grammar mistakes in code comments and documentation. No program logic, code behavior, or security properties were changed.
No action required. This is a documentation-only cleanup commit with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies four documentation-only lines across four files in the consensus_encoding crate. Changes include correcting ‘stblib’ to ‘stdlib’, ‘byteslice’ to ‘byte slice’, ‘return’ to ‘returns’, and rewording a doc comment about vector encoding. There are no code changes, no API changes, and no security implications.
Changed components
consensus_encoding/src/decode/decoders.rsconsensus_encoding/src/decode/mod.rsconsensus_encoding/src/encode/mod.rsconsensus_encoding/src/lib.rsInspect captured patch +6 / −5
diff --git a/consensus_encoding/src/decode/decoders.rs b/consensus_encoding/src/decode/decoders.rs
index a39d6264..ab9ab5b3 100644
--- a/consensus_encoding/src/decode/decoders.rs
+++ b/consensus_encoding/src/decode/decoders.rs
@@ -147,7 +147,8 @@ impl Decoder for ByteVecDecoder {
/// A decoder that decodes a vector of `T`s.
///
-/// The decoding is expected to start with expected number of items in the vector.
+/// The vector encoding must start with the number of items in the vector, encoded as a compact
+/// size.
#[cfg(feature = "alloc")]
pub struct VecDecoder<T: Decode> {
prefix_decoder: Option<CompactSizeDecoder>,
diff --git a/consensus_encoding/src/decode/mod.rs b/consensus_encoding/src/decode/mod.rs
index 2b9c3ceb..bdd3c7ff 100644
--- a/consensus_encoding/src/decode/mod.rs
+++ b/consensus_encoding/src/decode/mod.rs
@@ -80,7 +80,7 @@ pub trait Decoder: Sized {
#[track_caller]
fn push_bytes(&mut self, bytes: &mut &[u8]) -> Result<DecoderStatus, Self::Error>;
- /// Completes the decoding process and return the final result.
+ /// Completes the decoding process and returns the final result.
///
/// This consumes the decoder and should be called when no more input data is available.
///
diff --git a/consensus_encoding/src/encode/mod.rs b/consensus_encoding/src/encode/mod.rs
index 2456b836..08d8ccba 100644
--- a/consensus_encoding/src/encode/mod.rs
+++ b/consensus_encoding/src/encode/mod.rs
@@ -49,7 +49,7 @@ pub trait Encode {
/// An encoder for a consensus-encodable object.
///
-/// The consumers of type implementing this encoder trait should generally use it in a loop like
+/// The consumers of a type implementing this encoder trait should generally use it in a loop like
/// this:
///
/// ```no-compile
@@ -74,7 +74,7 @@ pub trait Encode {
/// implementors are allowed to change the sizes of the chunks as long as the concatenation of all
/// the bytes returned stays the same.
pub trait Encoder {
- /// Yields the current encoded byteslice.
+ /// Yields the current encoded byte slice.
///
/// Will always return the same value until [`Self::advance`] is called.
/// May return an empty slice, however implementors should avoid returning empty slices unless
diff --git a/consensus_encoding/src/lib.rs b/consensus_encoding/src/lib.rs
index 78904ad5..e9043293 100644
--- a/consensus_encoding/src/lib.rs
+++ b/consensus_encoding/src/lib.rs
@@ -35,7 +35,7 @@
//! This crate provides free functions which drive codecs for common I/O interfaces. On the decoding
//! side we provide:
//!
-//! * [`decode_from_read`]: Decode from a stblib buffered reader.
+//! * [`decode_from_read`]: Decode from a stdlib buffered reader.
//! * [`decode_from_read_unbuffered`]: Decode from a stdlib unbuffered reader (4k buffer on stack).
//! * [`decode_from_read_unbuffered_with`]: As above with custom sized stack-allocated buffer.
//! * [`decode_from_slice`]: Decode from a byte slice (errors if slice is not completely consumed).
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.