about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-11 14:02:24 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-11 14:02:24 -0800
commit9492275106dd4d564a036517ff4726feacaf0720 (patch)
treeb8b7afd170847f5de8d4b056c7a581fbcc8f4dd5 /src/libtest
parent43a200441674a4f58a55b181cff08d60fa25014c (diff)
parenta828e7948069f310dc5b33be8edb65e5e8e0cf9a (diff)
downloadrust-9492275106dd4d564a036517ff4726feacaf0720.tar.gz
rust-9492275106dd4d564a036517ff4726feacaf0720.zip
rollup merge of #22188: alexcrichton/envv2
This commit tweaks the interface of the `std::env` module to make it more
ergonomic for common usage:

* `env::var` was renamed to `env::var_os`
* `env::var_string` was renamed to `env::var`
* `env::args` was renamed to `env::args_os`
* `env::args` was re-added as a panicking iterator over string values
* `env::vars` was renamed to `env::vars_os`
* `env::vars` was re-added as a panicking iterator over string values.

This should make common usage (e.g. unicode values everywhere) more ergonomic
as well as "the default". This is also a breaking change due to the differences
of what's yielded from each of these functions, but migration should be fairly
easy as the defaults operate over `String` which is a common type to use.

[breaking-change]
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index fb22067ee94..cc7ea343ee2 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -387,7 +387,7 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
 
     let mut nocapture = matches.opt_present("nocapture");
     if !nocapture {
-        nocapture = env::var("RUST_TEST_NOCAPTURE").is_some();
+        nocapture = env::var("RUST_TEST_NOCAPTURE").is_ok();
     }
 
     let color = match matches.opt_str("color").as_ref().map(|s| &**s) {
@@ -813,7 +813,7 @@ fn run_tests<F>(opts: &TestOpts,
 
 fn get_concurrency() -> uint {
     use std::rt;
-    match env::var_string("RUST_TEST_TASKS") {
+    match env::var("RUST_TEST_TASKS") {
         Ok(s) => {
             let opt_n: Option<uint> = s.parse().ok();
             match opt_n {