Browse Source

is it "an str" (ess-tee-arh) or "a str" (stir)?

edition-2021
Lynne Megido 3 months ago
parent
commit
afa2bb8784
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
  1. 6
      src/utils.rs

6
src/utils.rs

@ -24,11 +24,11 @@ static CLAP_VERSION: OnceCell<String> = OnceCell::new();
static CLAP_LONG_VERSION: OnceCell<String> = 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!(

Loading…
Cancel
Save