From 5284c4ea6363ce27c09b00690e8dfcf1de80d139 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Fri, 13 Feb 2015 15:03:15 +0200 Subject: [PATCH] Remove a few uses of deprecated getenv --- src/librustc_back/target/mod.rs | 3 +-- src/libstd/sync/mpsc/mod.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 4d90c492fa2..b80a486b191 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -384,8 +384,7 @@ impl Target { Path::new(target) }; - let target_path = env::var_os("RUST_TARGET_PATH") - .unwrap_or(OsString::from_str("")); + let target_path = env::var_os("RUST_TARGET_PATH").unwrap_or(OsString::from_str("")); // FIXME 16351: add a sane default search path? diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 2e60d684d68..d783acd57ac 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1024,14 +1024,14 @@ impl fmt::Display for TryRecvError { mod test { use prelude::v1::*; - use os; + use std::env; use super::*; use thread::Thread; pub fn stress_factor() -> uint { - match os::getenv("RUST_TEST_STRESS") { - Some(val) => val.parse().unwrap(), - None => 1, + match env::var("RUST_TEST_STRESS") { + Ok(val) => val.parse().unwrap(), + Err(..) => 1, } } @@ -1546,14 +1546,14 @@ mod test { mod sync_tests { use prelude::v1::*; - use os; + use std::env; use thread::Thread; use super::*; pub fn stress_factor() -> uint { - match os::getenv("RUST_TEST_STRESS") { - Some(val) => val.parse().unwrap(), - None => 1, + match env::var("RUST_TEST_STRESS") { + Ok(val) => val.parse().unwrap(), + Err(..) => 1, } }