Move rust memchr impl to libcore

This commit is contained in:
Manish Goregaokar
2017-12-13 01:02:19 -06:00
parent 707d070815
commit 2bf0df777b
9 changed files with 234 additions and 232 deletions

View File

@@ -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};

View File

@@ -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)

View File

@@ -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};

View File

@@ -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};