diff --git a/src/utils.rs b/src/utils.rs index c0f3473..621e49c 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -24,11 +24,11 @@ static CLAP_VERSION: OnceCell = OnceCell::new(); static CLAP_LONG_VERSION: OnceCell = OnceCell::new(); /// Sets [`CLAP_VERSION`] to be the version defined in Cargo.toml, prefixed with a v (e.g. "v0.3.1"), then returns it as -/// a String. +/// an str. pub fn clap_version() -> &'static str { CLAP_VERSION.get_or_init(|| String::from("v") + VERSION.unwrap_or("???")) } -/// Sets [`CLAP_LONG_VERSION`] to be similar to [`CLAP_VERSION`], followed by the chosen backend in parentheses (e.g. -/// "v0.3.1 (XDG-Mime backend)"), then returns it as a String. +/// Sets [`CLAP_LONG_VERSION`] to be similar to [`CLAP_VERSION`], followed by the chosen backend and abbreviated git +/// commit hash in parentheses (e.g. "v0.3.6 (XDG-Mime backend, commit #043e097)"), then returns it as an str. pub fn clap_long_version() -> &'static str { CLAP_LONG_VERSION.get_or_init(|| { format!(