From 7257251ecf23af18deb894e8f2e5519a15360c76 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 6 Jan 2022 17:48:18 +0000 Subject: [PATCH] Use `or_else` to save potentially unnecessary function call --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 7c0b08c8..7d0a7bce 100644 --- a/build.rs +++ b/build.rs @@ -18,7 +18,7 @@ fn main() { // Support $BWRS_VERSION for legacy compatibility, but default to $VW_VERSION. // If neither exist, read from git. 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 { println!("cargo:rustc-env=VW_VERSION={}", version);