Skip to content

Commit 79dec43

Browse files
authored
doc: fix typos and spelling mistakes
Found via `codespell -S *.txt -L crate,upto,fo` PR #140
1 parent 898ee3f commit 79dec43

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/ext_slice.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,11 +1324,11 @@ pub trait ByteSlice: Sealed {
13241324
SplitReverse::new(self.as_bytes(), splitter.as_ref())
13251325
}
13261326

1327-
/// Split this byte string at the first occurance of `splitter`.
1327+
/// Split this byte string at the first occurrence of `splitter`.
13281328
///
13291329
/// If the `splitter` is found in the byte string, returns a tuple
1330-
/// containing the parts of the string before and after the first occurance
1331-
/// of `splitter` respectively. Otherwise, if there are no occurances of
1330+
/// containing the parts of the string before and after the first occurrence
1331+
/// of `splitter` respectively. Otherwise, if there are no occurrences of
13321332
/// `splitter` in the byte string, returns `None`.
13331333
///
13341334
/// The splitter may be any type that can be cheaply converted into a
@@ -1368,11 +1368,11 @@ pub trait ByteSlice: Sealed {
13681368
Some((&bytes[..start], &bytes[end..]))
13691369
}
13701370

1371-
/// Split this byte string at the last occurance of `splitter`.
1371+
/// Split this byte string at the last occurrence of `splitter`.
13721372
///
13731373
/// If the `splitter` is found in the byte string, returns a tuple
1374-
/// containing the parts of the string before and after the last occurance
1375-
/// of `splitter`, respectively. Otherwise, if there are no occurances of
1374+
/// containing the parts of the string before and after the last occurrence
1375+
/// of `splitter`, respectively. Otherwise, if there are no occurrences of
13761376
/// `splitter` in the byte string, returns `None`.
13771377
///
13781378
/// The splitter may be any type that can be cheaply converted into a
@@ -1915,7 +1915,7 @@ pub trait ByteSlice: Sealed {
19151915
/// assert_eq!(vec![(0, 5, "à̖"), (5, 13, "🇺🇸")], graphemes);
19161916
/// ```
19171917
///
1918-
/// This example shows what happens when invalid UTF-8 is enountered. Note
1918+
/// This example shows what happens when invalid UTF-8 is encountered. Note
19191919
/// that the offsets are valid indices into the original string, and do
19201920
/// not necessarily correspond to the length of the `&str` returned!
19211921
///

src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::io;
1313

1414
use crate::{ext_slice::ByteSlice, ext_vec::ByteVec};
1515

16-
/// An extention trait for
16+
/// An extension trait for
1717
/// [`std::io::BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)
1818
/// which provides convenience APIs for dealing with byte strings.
1919
pub trait BufReadExt: io::BufRead {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ additional string oriented methods. Operations such as iterating over
3434
graphemes, searching for substrings, replacing substrings, trimming and case
3535
conversion are examples of things not provided on the standard library `&[u8]`
3636
APIs but are provided by this crate. For example, this code iterates over all
37-
of occurrences of a subtring:
37+
of occurrences of a substring:
3838
3939
```
4040
use bstr::ByteSlice;

src/utf8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl<'a> ::core::iter::FusedIterator for Utf8Chunks<'a> {}
388388
/// assert_eq!(err.error_len(), Some(3));
389389
///
390390
/// // In contrast to the above which contains a single invalid prefix,
391-
/// // consider the case of multiple individal bytes that are never valid
391+
/// // consider the case of multiple individual bytes that are never valid
392392
/// // prefixes. Note how the value of error_len changes!
393393
/// let s = b"foobar\xFF\xFFquux";
394394
/// let err = s.to_str().unwrap_err();

0 commit comments

Comments
 (0)