We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c4df3f9 + d7cdd56 commit 1809c14Copy full SHA for 1809c14
src/libcore/slice/memchr.rs
@@ -56,7 +56,7 @@ fn repeat_byte(b: u8) -> usize {
56
rep
57
}
58
59
-/// Return the first index matching the byte `a` in `text`.
+/// Return the first index matching the byte `x` in `text`.
60
pub fn memchr(x: u8, text: &[u8]) -> Option<usize> {
61
// Scan for a single byte value by reading two `usize` words at a time.
62
//
@@ -101,7 +101,7 @@ pub fn memchr(x: u8, text: &[u8]) -> Option<usize> {
101
text[offset..].iter().position(|elt| *elt == x).map(|i| offset + i)
102
103
104
-/// Return the last index matching the byte `a` in `text`.
+/// Return the last index matching the byte `x` in `text`.
105
pub fn memrchr(x: u8, text: &[u8]) -> Option<usize> {
106
107
0 commit comments