Skip to content

Commit 95dd0de

Browse files
committed
pr feedback
1 parent 96b3a32 commit 95dd0de

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

bindings/rust/extended/s2n-tls/build.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ const EXTERNAL_BUILD_CFG_NAME: &str = "s2n_tls_external_build";
77
fn main() {
88
println!("cargo:rustc-check-cfg=cfg({EXTERNAL_BUILD_CFG_NAME})");
99

10-
for (name, value) in std::env::vars() {
11-
/* s2n-tls-sys exports the external build environment variable when libs2n is externally
12-
* linked. Set a cfg attribute in this case to allow s2n-tls to be aware of the external
13-
* build.
14-
*/
15-
if name == EXTERNAL_BUILD_ENV_NAME {
16-
println!("cargo:rerun-if-env-changed={EXTERNAL_BUILD_ENV_NAME}");
10+
/* s2n-tls-sys exports the external build environment variable when libs2n is externally
11+
* linked. Set a cfg attribute in this case to allow s2n-tls to be aware of the external build.
12+
*/
13+
if let Some(external_build_var) = std::env::var(EXTERNAL_BUILD_ENV_NAME) {
14+
println!("cargo:rerun-if-env-changed={EXTERNAL_BUILD_ENV_NAME}");
1715

18-
let external_build: bool = value.parse().unwrap();
19-
if external_build {
20-
println!("cargo:rustc-cfg={EXTERNAL_BUILD_CFG_NAME}");
21-
}
16+
let external_build: bool = external_build_var.parse().unwrap();
17+
if external_build {
18+
println!("cargo:rustc-cfg={EXTERNAL_BUILD_CFG_NAME}");
2219
}
2320
}
2421
}

0 commit comments

Comments
 (0)