Move rust memchr impl to libcore
This commit is contained in:
@@ -11,4 +11,4 @@
|
||||
// Original implementation taken from rust-memchr
|
||||
// Copyright 2015 Andrew Gallant, bluss and Nicolas Koch
|
||||
|
||||
pub use sys_common::memchr::fallback::{memchr, memrchr};
|
||||
pub use core::slice::memchr::{memchr, memrchr};
|
||||
|
||||
@@ -50,7 +50,7 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> {
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
|
||||
::sys_common::memchr::fallback::memrchr(needle, haystack)
|
||||
::core::slice::memchr::memrchr(needle, haystack)
|
||||
}
|
||||
|
||||
memrchr_specific(needle, haystack)
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub use sys_common::memchr::fallback::{memchr, memrchr};
|
||||
pub use core::slice::memchr::{memchr, memrchr};
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
// Copyright 2015 Andrew Gallant, bluss and Nicolas Koch
|
||||
|
||||
// Fallback memchr is fastest on windows
|
||||
pub use sys_common::memchr::fallback::{memchr, memrchr};
|
||||
pub use core::slice::memchr::{memchr, memrchr};
|
||||
|
||||
Reference in New Issue
Block a user