From a55ad1cc44c12836eca5652d231902968e04eea1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 5 May 2026 12:20:32 +0900 Subject: refactor(core): centralize version constant in mozart-core --- crates/mozart-core/src/http.rs | 3 ++- crates/mozart-core/src/lib.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/mozart-core/src') diff --git a/crates/mozart-core/src/http.rs b/crates/mozart-core/src/http.rs index 7d3de8e..907b6a7 100644 --- a/crates/mozart-core/src/http.rs +++ b/crates/mozart-core/src/http.rs @@ -1,3 +1,4 @@ +use crate::MOZART_VERSION; use std::path::{Path, PathBuf}; use std::sync::OnceLock; @@ -9,7 +10,7 @@ use anyhow::{Context, Result, anyhow, bail}; pub fn user_agent() -> String { format!( "Mozart/{} ({}; {})", - env!("CARGO_PKG_VERSION"), + MOZART_VERSION, std::env::consts::OS, std::env::consts::ARCH, ) diff --git a/crates/mozart-core/src/lib.rs b/crates/mozart-core/src/lib.rs index 5383d9a..bc0da53 100644 --- a/crates/mozart-core/src/lib.rs +++ b/crates/mozart-core/src/lib.rs @@ -10,3 +10,5 @@ pub mod wildcard; pub use mozart_console_macros::console_format; pub use wildcard::matches_wildcard; + +pub const MOZART_VERSION: &str = env!("CARGO_PKG_VERSION"); -- cgit v1.3.1