Skip to content

Commit bc8d2ac

Browse files
committed
fix typos and add more links
1 parent 3f7797f commit bc8d2ac

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

src/builder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ pub trait EmptyBuilder {
219219
/// Creates a new empty octets builder with a suggested initial size.
220220
///
221221
/// The builder may or may not use the size provided by `capacity` as the
222-
/// initial size of the buffer. It may very well be possibly that the
222+
/// initial size of the buffer. It may very well be possible that the
223223
/// builder is never able to grow to this capacity at all. Therefore,
224224
/// even if you create a builder for your data size via this function,
225225
/// appending may still fail.
@@ -274,12 +274,12 @@ impl<const N: usize> EmptyBuilder for heapless::Vec<u8, N> {
274274

275275
//------------ FreezeBuilder -------------------------------------------------
276276

277-
/// An octets builder that can be frozen into a imutable octets sequence.
277+
/// An octets builder that can be frozen into a immutable octets sequence.
278278
pub trait FreezeBuilder {
279279
/// The type of octets sequence to builder will be frozen into.
280280
type Octets;
281281

282-
/// Converts the octets builder into an imutable octets sequence.
282+
/// Converts the octets builder into an immutable octets sequence.
283283
fn freeze(self) -> Self::Octets;
284284
}
285285

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This crate provides a set of basic traits that allow defining types that
44
//! are generic over a variable length sequence of octets (or, vulgo: bytes).
55
//!
6-
//! There are two groups of traits: those that represent behavior of imutable
6+
//! There are two groups of traits: those that represent behavior of immutable
77
//! octets sequences are collected in the module _[octets]_ and those for
88
//! building such sequences are in _[builder]_. Most traits from these modules
99
//! are also re-exported at the crate root for convenience.
@@ -23,7 +23,7 @@
2323
//!
2424
//! * The _[mod@array]_ module provides an octets builder backed by an octets
2525
//! array.
26-
//! * The _[mod@str]_ module provides both imutable and buildable string types
26+
//! * The _[mod@str]_ module provides both immutable and buildable string types
2727
//! that are generic over the octets sequence they wrap.
2828
//! * The
2929
#![cfg_attr(feature = "serde", doc = " _[serde]_")]

src/parse.rs

+3-13
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ use crate::octets::Octets;
1212

1313
/// A parser for sequentially extracting data from an octets sequence.
1414
///
15-
/// The parser wraps an [octets reference] and remembers the read position on
15+
/// The parser wraps an [Octets] reference and remembers the read position on
1616
/// the referenced sequence. Methods allow reading out data and progressing
1717
/// the position beyond processed data.
18-
///
19-
/// [octets reference]: trait.OctetsRef.html
2018
#[derive(Debug)]
2119
pub struct Parser<'a, Octs: ?Sized> {
2220
/// The underlying octets reference.
@@ -26,10 +24,6 @@ pub struct Parser<'a, Octs: ?Sized> {
2624
pos: usize,
2725

2826
/// The length of the octets sequence.
29-
///
30-
/// This starts out as the length of the underlying sequence and is kept
31-
/// here to be able to temporarily limit the allowed length for
32-
/// `parse_blocks`.
3327
len: usize,
3428
}
3529

@@ -136,9 +130,7 @@ impl<'a, Octs: ?Sized> Parser<'a, Octs> {
136130
/// Returns the length of the underlying octet sequence.
137131
///
138132
/// This is _not_ the number of octets left for parsing. Use
139-
/// [`remaining`] for that.
140-
///
141-
/// [`remaining`]: #method.remaining
133+
/// [`Parser::remaining`] for that.
142134
pub fn len(&self) -> usize {
143135
self.len
144136
}
@@ -164,9 +156,7 @@ impl<'a, Octs: AsRef<[u8]> + ?Sized> Parser<'a, Octs> {
164156
/// Returns an octets slice of the underlying sequence.
165157
///
166158
/// The slice covers the entire sequence, not just the remaining data. You
167-
/// can use [`peek`] for that.
168-
///
169-
/// [`peek`]: #method.peek
159+
/// can use [`Parser::peek`] for that.
170160
pub fn as_slice(&self) -> &[u8] {
171161
&self.octets.as_ref()[..self.len]
172162
}

src/str.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Strings atop octet sequences.
22
//!
3-
//! This module provides the type `Str<Octets>` that guarantees the same
3+
//! This module provides the type [`Str<Octets>`] that guarantees the same
44
//! invariants – namely that the content is an UTF-8 encoded string – as
5-
//! the standard library’s `str` and `String` types but atop a generic
5+
//! the standard library’s [`str`] and [`String`] types but atop a generic
66
//! octet sequence.
77
88
use core::{borrow, cmp, fmt, hash, ops, str};
@@ -42,7 +42,7 @@ impl<Octets> Str<Octets> {
4242
Self(octets)
4343
}
4444

45-
/// Creates a value by copying the content of a `str`.
45+
/// Creates a value by copying the content of a [`str`].
4646
pub fn try_copy_from_str(
4747
s: &str
4848
) -> Result<Self, BuilderAppendError<Octets>>
@@ -55,7 +55,7 @@ impl<Octets> Str<Octets> {
5555
Ok(unsafe { Self::from_utf8_unchecked(res.freeze()) })
5656
}
5757

58-
/// Creates a value by copying the content of a `str`.
58+
/// Creates a value by copying the content of a [`str`].
5959
///
6060
/// This function is identical to
6161
/// [`try_copy_from_str`][Self::try_copy_from_str] for octets types

0 commit comments

Comments
 (0)