From 8ebc31c32aa81bbc4eccb5a52d483018d1e84270 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 8 Mar 2019 06:51:23 -0800 Subject: [PATCH] Use `self.getenv` instead of `env::var` This prints out some more debugging information which can occasionally be helpful! --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 72e9221..ed16763 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -956,7 +956,7 @@ impl Build { fn compile_objects(&self, objs: &[Object]) -> Result<(), Error> { use self::rayon::prelude::*; - if let Ok(amt) = env::var("NUM_JOBS") { + if let Some(amt) = self.getenv("NUM_JOBS") { if let Ok(amt) = amt.parse() { let _ = rayon::ThreadPoolBuilder::new() .num_threads(amt) @@ -1179,7 +1179,7 @@ impl Build { Some(false) => "/MD", None => { let features = - env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new()); + self.getenv("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new()); if features.contains("crt-static") { "/MT" } else { @@ -1274,7 +1274,7 @@ impl Build { } if self.static_flag.is_none() { - let features = env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new()); + let features = self.getenv("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new()); if features.contains("crt-static") { cmd.args.push("-static".into()); }