diff options
author | Alex Auvolat <alex@adnab.me> | 2023-05-09 12:40:08 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-05-09 12:40:08 +0200 |
commit | 351d734e6c035a6f22f9fe0d62a783a81a134f45 (patch) | |
tree | ded5a11616d5147ed254bba2974d3591fb1e041f /src/util/version.rs | |
parent | a1fcf1b175cc11b4e797d81ea483538813732d6d (diff) | |
parent | b925f53dc3b0bae77aa3f73e581faace2eb3b21a (diff) | |
download | garage-351d734e6c035a6f22f9fe0d62a783a81a134f45.tar.gz garage-351d734e6c035a6f22f9fe0d62a783a81a134f45.zip |
Merge branch 'main' into next
Diffstat (limited to 'src/util/version.rs')
-rw-r--r-- | src/util/version.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/util/version.rs b/src/util/version.rs index 2b2ea271..19907ed1 100644 --- a/src/util/version.rs +++ b/src/util/version.rs @@ -1,18 +1,14 @@ use std::sync::Arc; -use arc_swap::{ArcSwap, ArcSwapOption}; +use arc_swap::ArcSwapOption; lazy_static::lazy_static! { - static ref VERSION: ArcSwap<&'static str> = ArcSwap::new(Arc::new(git_version::git_version!( - prefix = "git:", - cargo_prefix = "cargo:", - fallback = "unknown" - ))); + static ref VERSION: ArcSwapOption<&'static str> = ArcSwapOption::new(None); static ref FEATURES: ArcSwapOption<&'static [&'static str]> = ArcSwapOption::new(None); } pub fn garage_version() -> &'static str { - &VERSION.load() + VERSION.load().as_ref().unwrap() } pub fn garage_features() -> Option<&'static [&'static str]> { @@ -20,7 +16,7 @@ pub fn garage_features() -> Option<&'static [&'static str]> { } pub fn init_version(version: &'static str) { - VERSION.store(Arc::new(version)); + VERSION.store(Some(Arc::new(version))); } pub fn init_features(features: &'static [&'static str]) { |