Browse Source
Use `or_else` to save potentially unnecessary function call
pull/2195/head
Jake Howard
4 years ago
No known key found for this signature in database
GPG Key ID: 57AFB45680EDD477
1 changed files with
1 additions and
1 deletions
-
build.rs
|
@ -18,7 +18,7 @@ fn main() { |
|
|
// Support $BWRS_VERSION for legacy compatibility, but default to $VW_VERSION.
|
|
|
// Support $BWRS_VERSION for legacy compatibility, but default to $VW_VERSION.
|
|
|
// If neither exist, read from git.
|
|
|
// If neither exist, read from git.
|
|
|
let maybe_vaultwarden_version = |
|
|
let maybe_vaultwarden_version = |
|
|
env::var("VW_VERSION").or(env::var("BWRS_VERSION")).or_else(|_| version_from_git_info()); |
|
|
env::var("VW_VERSION").or_else(|_| env::var("BWRS_VERSION")).or_else(|_| version_from_git_info()); |
|
|
|
|
|
|
|
|
if let Ok(version) = maybe_vaultwarden_version { |
|
|
if let Ok(version) = maybe_vaultwarden_version { |
|
|
println!("cargo:rustc-env=VW_VERSION={}", version); |
|
|
println!("cargo:rustc-env=VW_VERSION={}", version); |
|
|