Skip to content

Commit 078a623

Browse files
committed
std: Use the fallback impl for memrchr on non-linux
This code was never used(!). This brings the memrchr improvements to non-linux platforms (LineWriter / buffered stdout benefits).
1 parent 9d21aca commit 078a623

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/memchr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> {
9898

9999
#[cfg(not(target_os = "linux"))]
100100
fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
101-
haystack.iter().rposition(|&b| b == needle)
101+
fallback::memrchr(needle, haystack)
102102
}
103103

104104
memrchr_specific(needle, haystack)

0 commit comments

Comments
 (0)