diff options
| author | Michael McConville <mmcco@mykolab.com> | 2015-12-18 22:37:00 -0500 |
|---|---|---|
| committer | Michael McConville <mmcco@mykolab.com> | 2015-12-18 22:37:00 -0500 |
| commit | e8d2706cbac46eac7f4cd1554c41c748e00a4a00 (patch) | |
| tree | 556cad53a8d415b3b3a660d756d3bc20bf1609cb /src/libstd/sys | |
| parent | 33113f86f4c4f191d1bf42642b1a7714c576e395 (diff) | |
| parent | 8ad12c3e251df6b8ed42b4d32709f4f55470a0be (diff) | |
| download | rust-e8d2706cbac46eac7f4cd1554c41c748e00a4a00.tar.gz rust-e8d2706cbac46eac7f4cd1554c41c748e00a4a00.zip | |
Merge branch 'master' of https://github.com/rust-lang/rust
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index c2bf0651cff..12b9d6191a0 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -22,6 +22,7 @@ use io; use iter; use libc::{self, c_int, c_char, c_void}; use mem; +use memchr; use path::{self, PathBuf}; use ptr; use slice; @@ -406,7 +407,7 @@ pub fn env() -> Env { if input.is_empty() { return None; } - let pos = input[1..].iter().position(|&b| b == b'=').map(|p| p + 1); + let pos = memchr::memchr(b'=', &input[1..]).map(|p| p + 1); pos.map(|p| ( OsStringExt::from_vec(input[..p].to_vec()), OsStringExt::from_vec(input[p+1..].to_vec()), |
