Move $BWRS_VERSION fallback into build.rs

This commit is contained in:
Jake Howard
2022-01-05 21:18:24 +00:00
parent 743ef74b30
commit 40ae81dd3c
2 changed files with 19 additions and 30 deletions

View File

@@ -76,15 +76,7 @@ const HELP: &str = "\
-v, --version Prints the app version
";
// HACK: Option::or cannot be used in a constant context
const fn get_version() -> Option<&'static str> {
let bwrs_version = option_env!("BWRS_VERSION");
match bwrs_version {
Some(_) => bwrs_version,
None => option_env!("VW_VERSION"),
}
}
pub const VERSION: Option<&str> = get_version();
pub const VERSION: Option<&str> = option_env!("VW_VERSION");
fn parse_args() {
let mut pargs = pico_args::Arguments::from_env();