summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-01 13:30:08 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-01 13:30:08 -0700
commite9bacbaa2c9c88aaecf07ee30f02d08a1999e5c6 (patch)
tree83ee5701b24c3f0608af96758fd4d5f78b9c8bae /src/libstd/sys
parentfb4029f8eadbf77a8d7a53fadb58decf3a1a49bc (diff)
parente98dce3e00a7b6bfd264418ef993bbf9cdb1f0b6 (diff)
downloadrust-e9bacbaa2c9c88aaecf07ee30f02d08a1999e5c6.tar.gz
rust-e9bacbaa2c9c88aaecf07ee30f02d08a1999e5c6.zip
rollup merge of #23951: alexcrichton/splitn
This commit is an implementation of [RFC 979][rfc] which changes the meaning of
the count parameter to the `splitn` function on strings and slices. The
parameter now means the number of items that are returned from the iterator, not
the number of splits that are made.

[rfc]: https://github.com/rust-lang/rfcs/pull/979

Closes #23911
[breaking-change]
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/os.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs
index 7b13e951b9b..d2220bdec32 100644
--- a/src/libstd/sys/unix/os.rs
+++ b/src/libstd/sys/unix/os.rs
@@ -409,7 +409,7 @@ pub fn env() -> Env {
     };
 
     fn parse(input: &[u8]) -> (OsString, OsString) {
-        let mut it = input.splitn(1, |b| *b == b'=');
+        let mut it = input.splitn(2, |b| *b == b'=');
         let key = it.next().unwrap().to_vec();
         let default: &[u8] = &[];
         let val = it.next().unwrap_or(default).to_vec();