Skip to content

Commit

Permalink
Add whitespace to compiler flags in long version string
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon authored and shssoichiro committed Jan 28, 2024
1 parent f6f4969 commit 7155fe3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/bin/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,14 @@ fn get_version() -> &'static str {

fn get_long_version() -> &'static str {
static LONG_VERSION_STR: Lazy<String> = Lazy::new(|| {
let mut rustflags = env!("CARGO_ENCODED_RUSTFLAGS");
if rustflags.trim().is_empty() {
rustflags = "(None)";
}
let rustflags = env!("CARGO_ENCODED_RUSTFLAGS");
let rustflags = if rustflags.trim().is_empty() {
"(None)".to_string()
} else {
// Replace non-printable ASCII Unit Separator with whitespace
rustflags.replace(0x1F as char, " ")
};

format!(
"{}\n{} {}\nCompiled CPU Features: {}\nRuntime Assembly Support: {}{}\nThreading: {}\nUnstable Features: {}\nCompiler Flags: {}",
get_version(),
Expand Down

0 comments on commit 7155fe3

Please sign in to comment.