Skip to content

Commit

Permalink
Rollup merge of rust-lang#47118 - hdhoang:patch-2, r=BurntSushi
Browse files Browse the repository at this point in the history
memchr: fix variable name in docstrings

upstream BurntSushi/memchr#24

r=BurntSushi
  • Loading branch information
kennytm authored Jan 3, 2018
2 parents d6cf5a5 + d7cdd56 commit 2182f14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/slice/memchr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn repeat_byte(b: u8) -> usize {
rep
}

/// Return the first index matching the byte `a` in `text`.
/// Return the first index matching the byte `x` in `text`.
pub fn memchr(x: u8, text: &[u8]) -> Option<usize> {
// Scan for a single byte value by reading two `usize` words at a time.
//
Expand Down Expand Up @@ -101,7 +101,7 @@ pub fn memchr(x: u8, text: &[u8]) -> Option<usize> {
text[offset..].iter().position(|elt| *elt == x).map(|i| offset + i)
}

/// Return the last index matching the byte `a` in `text`.
/// Return the last index matching the byte `x` in `text`.
pub fn memrchr(x: u8, text: &[u8]) -> Option<usize> {
// Scan for a single byte value by reading two `usize` words at a time.
//
Expand Down

0 comments on commit 2182f14

Please sign in to comment.