diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-05 12:20:32 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-05 12:55:09 +0900 |
| commit | a55ad1cc44c12836eca5652d231902968e04eea1 (patch) | |
| tree | 3e24d859a464dd716ecb92cc40c729bf281863f4 /crates/mozart-core | |
| parent | 14d3eb2b2f537140bf626b3d109e01834704e5bf (diff) | |
| download | php-mozart-a55ad1cc44c12836eca5652d231902968e04eea1.tar.gz php-mozart-a55ad1cc44c12836eca5652d231902968e04eea1.tar.zst php-mozart-a55ad1cc44c12836eca5652d231902968e04eea1.zip | |
refactor(core): centralize version constant in mozart-core
Diffstat (limited to 'crates/mozart-core')
| -rw-r--r-- | crates/mozart-core/src/http.rs | 3 | ||||
| -rw-r--r-- | crates/mozart-core/src/lib.rs | 2 |
2 files changed, 4 insertions, 1 deletions
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"); |
