diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 11:28:34 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 13:29:42 -0700 |
| commit | e98dce3e00a7b6bfd264418ef993bbf9cdb1f0b6 (patch) | |
| tree | 1569b4aa8d412df9c49904b8bddeb44d8d4ecef2 /src/librustc/session | |
| parent | d528aa9960cb9b937d8ef6c09905a6a8076d5f3a (diff) | |
| download | rust-e98dce3e00a7b6bfd264418ef993bbf9cdb1f0b6.tar.gz rust-e98dce3e00a7b6bfd264418ef993bbf9cdb1f0b6.zip | |
std: Changing the meaning of the count to 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/librustc/session')
| -rw-r--r-- | src/librustc/session/config.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index c67819ab7e3..5a598921195 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -304,7 +304,7 @@ macro_rules! options { { let mut op = $defaultfn(); for option in matches.opt_strs($prefix) { - let mut iter = option.splitn(1, '='); + let mut iter = option.splitn(2, '='); let key = iter.next().unwrap(); let value = iter.next(); let option_to_lookup = key.replace("-", "_"); @@ -958,7 +958,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { } let libs = matches.opt_strs("l").into_iter().map(|s| { - let mut parts = s.splitn(1, '='); + let mut parts = s.splitn(2, '='); let kind = parts.next().unwrap(); let (name, kind) = match (parts.next(), kind) { (None, name) | @@ -1010,7 +1010,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { let mut externs = HashMap::new(); for arg in &matches.opt_strs("extern") { - let mut parts = arg.splitn(1, '='); + let mut parts = arg.splitn(2, '='); let name = match parts.next() { Some(s) => s, None => early_error("--extern value must not be empty"), |
