Skip to content

Commit 7155fe3

Browse files
FreezyLemonshssoichiro
authored andcommitted
Add whitespace to compiler flags in long version string
1 parent f6f4969 commit 7155fe3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bin/common.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,14 @@ fn get_version() -> &'static str {
273273

274274
fn get_long_version() -> &'static str {
275275
static LONG_VERSION_STR: Lazy<String> = Lazy::new(|| {
276-
let mut rustflags = env!("CARGO_ENCODED_RUSTFLAGS");
277-
if rustflags.trim().is_empty() {
278-
rustflags = "(None)";
279-
}
276+
let rustflags = env!("CARGO_ENCODED_RUSTFLAGS");
277+
let rustflags = if rustflags.trim().is_empty() {
278+
"(None)".to_string()
279+
} else {
280+
// Replace non-printable ASCII Unit Separator with whitespace
281+
rustflags.replace(0x1F as char, " ")
282+
};
283+
280284
format!(
281285
"{}\n{} {}\nCompiled CPU Features: {}\nRuntime Assembly Support: {}{}\nThreading: {}\nUnstable Features: {}\nCompiler Flags: {}",
282286
get_version(),

0 commit comments

Comments
 (0)