Remove a few uses of deprecated getenv

This commit is contained in:
Simonas Kazlauskas 2015-02-13 15:03:15 +02:00
parent ba2efe96ae
commit 5284c4ea63
2 changed files with 9 additions and 10 deletions

View File

@ -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?

View File

@ -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,
}
}