Skip to content

Commit 8ebc31c

Browse files
committed
Use self.getenv instead of env::var
This prints out some more debugging information which can occasionally be helpful!
1 parent a3d8ff6 commit 8ebc31c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ impl Build {
956956
fn compile_objects(&self, objs: &[Object]) -> Result<(), Error> {
957957
use self::rayon::prelude::*;
958958

959-
if let Ok(amt) = env::var("NUM_JOBS") {
959+
if let Some(amt) = self.getenv("NUM_JOBS") {
960960
if let Ok(amt) = amt.parse() {
961961
let _ = rayon::ThreadPoolBuilder::new()
962962
.num_threads(amt)
@@ -1179,7 +1179,7 @@ impl Build {
11791179
Some(false) => "/MD",
11801180
None => {
11811181
let features =
1182-
env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new());
1182+
self.getenv("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new());
11831183
if features.contains("crt-static") {
11841184
"/MT"
11851185
} else {
@@ -1274,7 +1274,7 @@ impl Build {
12741274
}
12751275

12761276
if self.static_flag.is_none() {
1277-
let features = env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new());
1277+
let features = self.getenv("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new());
12781278
if features.contains("crt-static") {
12791279
cmd.args.push("-static".into());
12801280
}

0 commit comments

Comments
 (0)