use std::collections::HashSet;
use std::sync::{LazyLock, Mutex, OnceLock};
use versions::Versioning;
static VERSION: OnceLock<Versioning> = OnceLock::new();
#[doc(hidden)]
pub static DEPRECATED: LazyLock<Mutex<HashSet<&'static str>>> = LazyLock::new(Default::default);
pub fn set_version(version: &str) {
let _ = VERSION.set(Versioning::new(version).expect("invalid mise version"));
}
pub static VERSION_PLAIN: LazyLock<String> = LazyLock::new(|| {
let mut v = version().to_string();
if cfg!(debug_assertions) {
v.push_str("-DEBUG");
}
v
});
pub fn version() -> &'static Versioning {
VERSION
.get()
.expect("mise_util::deprecation::set_version must be called first")
}