Skip to content

Commit 2182f14

Browse files
authored
Rollup merge of rust-lang#47118 - hdhoang:patch-2, r=BurntSushi
memchr: fix variable name in docstrings upstream BurntSushi/memchr#24 r=BurntSushi
2 parents d6cf5a5 + d7cdd56 commit 2182f14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/slice/memchr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn repeat_byte(b: u8) -> usize {
5656
rep
5757
}
5858

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

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

0 commit comments

Comments
 (0)