Skip to content

Commit f927d2a

Browse files
author
Jon Gjengset
committed
Don't filter empty arguments with encoded rustflags
1 parent 8199f85 commit f927d2a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,10 @@ fn env_args(
599599
// First try CARGO_ENCODED_RUSTFLAGS from the environment.
600600
// Prefer this over RUSTFLAGS since it's less prone to encoding errors.
601601
if let Ok(a) = env::var(format!("CARGO_ENCODED_{}", name)) {
602-
let args = a
603-
.split('\x1f')
604-
.filter(|s| !s.is_empty())
605-
.map(str::to_string);
606-
return Ok(args.collect());
602+
if a.is_empty() {
603+
return Ok(Vec::new());
604+
}
605+
return Ok(a.split('\x1f').map(str::to_string).collect());
607606
}
608607

609608
// Then try RUSTFLAGS from the environment

0 commit comments

Comments
 (0)