Rollup merge of #47118 - hdhoang:patch-2, r=BurntSushi
memchr: fix variable name in docstrings upstream BurntSushi/rust-memchr#24 r=BurntSushi
This commit is contained in:
commit
2182f1431c
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue