Skip to content

Commit

Permalink
memchr: fix variable name in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
hdhoang authored Jan 1, 2018
1 parent 037bc65 commit d7cdd56
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 d7cdd56

Please sign in to comment.