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/src/commands/self_update.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'crates/mozart/src/commands/self_update.rs') diff --git a/crates/mozart/src/commands/self_update.rs b/crates/mozart/src/commands/self_update.rs index 2c7c59b..401d15a 100644 --- a/crates/mozart/src/commands/self_update.rs +++ b/crates/mozart/src/commands/self_update.rs @@ -1,4 +1,5 @@ use clap::Args; +use mozart_core::MOZART_VERSION; use mozart_core::console::Verbosity; use mozart_core::console_format; use std::io::Write; @@ -91,12 +92,6 @@ fn get_data_dir() -> anyhow::Result { .join("mozart")) } -// ─── Version helpers ────────────────────────────────────────────────────────── - -fn get_current_version() -> &'static str { - env!("CARGO_PKG_VERSION") -} - /// Returns the platform-specific binary asset name for the current build target. /// /// Examples: `mozart-linux-x86_64`, `mozart-macos-aarch64`, `mozart-windows-x86_64.exe` @@ -286,7 +281,7 @@ async fn update( data_dir: &Path, console: &mozart_core::console::Console, ) -> anyhow::Result<()> { - let current_version = get_current_version(); + let current_version = MOZART_VERSION; let channel = effective_channel(args.preview); // Fetch releases -- cgit v1.3.1