aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-05-09 12:40:08 +0200
committerAlex Auvolat <alex@adnab.me>2023-05-09 12:40:08 +0200
commit351d734e6c035a6f22f9fe0d62a783a81a134f45 (patch)
treeded5a11616d5147ed254bba2974d3591fb1e041f /src/util
parenta1fcf1b175cc11b4e797d81ea483538813732d6d (diff)
parentb925f53dc3b0bae77aa3f73e581faace2eb3b21a (diff)
downloadgarage-351d734e6c035a6f22f9fe0d62a783a81a134f45.tar.gz
garage-351d734e6c035a6f22f9fe0d62a783a81a134f45.zip
Merge branch 'main' into next
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Cargo.toml3
-rw-r--r--src/util/version.rs12
2 files changed, 5 insertions, 10 deletions
diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml
index 387471ed..27ef4550 100644
--- a/src/util/Cargo.toml
+++ b/src/util/Cargo.toml
@@ -14,7 +14,7 @@ path = "lib.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-garage_db = { version = "0.8.2", path = "../db" }
+garage_db.workspace = true
arc-swap = "1.0"
async-trait = "0.1"
@@ -22,7 +22,6 @@ blake2 = "0.10"
bytes = "1.0"
digest = "0.10"
err-derive = "0.3"
-git-version = "0.3.4"
hexdump = "0.1"
xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] }
hex = "0.4"
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]) {