File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
bindings/rust/extended/s2n-tls Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -7,18 +7,15 @@ const EXTERNAL_BUILD_CFG_NAME: &str = "s2n_tls_external_build";
7
7
fn main ( ) {
8
8
println ! ( "cargo:rustc-check-cfg=cfg({EXTERNAL_BUILD_CFG_NAME})" ) ;
9
9
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}" ) ;
17
15
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}" ) ;
22
19
}
23
20
}
24
21
}
You can’t perform that action at this time.
0 commit comments