Skip to content

Commit 5284c4e

Browse files
committed
Remove a few uses of deprecated getenv
1 parent ba2efe9 commit 5284c4e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/librustc_back/target/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,7 @@ impl Target {
384384
Path::new(target)
385385
};
386386

387-
let target_path = env::var_os("RUST_TARGET_PATH")
388-
.unwrap_or(OsString::from_str(""));
387+
let target_path = env::var_os("RUST_TARGET_PATH").unwrap_or(OsString::from_str(""));
389388

390389
// FIXME 16351: add a sane default search path?
391390

src/libstd/sync/mpsc/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,14 +1024,14 @@ impl fmt::Display for TryRecvError {
10241024
mod test {
10251025
use prelude::v1::*;
10261026

1027-
use os;
1027+
use std::env;
10281028
use super::*;
10291029
use thread::Thread;
10301030

10311031
pub fn stress_factor() -> uint {
1032-
match os::getenv("RUST_TEST_STRESS") {
1033-
Some(val) => val.parse().unwrap(),
1034-
None => 1,
1032+
match env::var("RUST_TEST_STRESS") {
1033+
Ok(val) => val.parse().unwrap(),
1034+
Err(..) => 1,
10351035
}
10361036
}
10371037

@@ -1546,14 +1546,14 @@ mod test {
15461546
mod sync_tests {
15471547
use prelude::v1::*;
15481548

1549-
use os;
1549+
use std::env;
15501550
use thread::Thread;
15511551
use super::*;
15521552

15531553
pub fn stress_factor() -> uint {
1554-
match os::getenv("RUST_TEST_STRESS") {
1555-
Some(val) => val.parse().unwrap(),
1556-
None => 1,
1554+
match env::var("RUST_TEST_STRESS") {
1555+
Ok(val) => val.parse().unwrap(),
1556+
Err(..) => 1,
15571557
}
15581558
}
15591559

0 commit comments

Comments
 (0)