From 2bc47940be9359e34cfe50c64fe76234999bc716 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 6 May 2026 04:02:24 +0900 Subject: refactor(console): rename color helpers and migrate call sites to console_format! The six tag-style color functions (info, comment, error, question, highlight, warning) are pub only so that console_format! can call them from generated code; they are not part of the public API. Rename them to __format_*_message to make that intent visible, add a doc-comment saying not to call them directly, and replace every remaining direct call site with console_format!. Co-Authored-By: Claude Sonnet 4.6 --- crates/mozart/src/commands/outdated.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'crates/mozart/src/commands/outdated.rs') diff --git a/crates/mozart/src/commands/outdated.rs b/crates/mozart/src/commands/outdated.rs index 2b25816..46f09f9 100644 --- a/crates/mozart/src/commands/outdated.rs +++ b/crates/mozart/src/commands/outdated.rs @@ -1,5 +1,6 @@ use clap::Args; use indexmap::IndexSet; +use mozart_core::console_format; use mozart_core::console_writeln; use mozart_core::matches_wildcard; use std::cmp::Ordering; @@ -442,7 +443,7 @@ fn render_text(entries: &[OutdatedEntry], console: &mozart_core::console::Consol if entries.is_empty() { console_writeln!( console, - &mozart_core::console::info("All packages are up to date.").to_string(), + &console_format!("All packages are up to date."), ); return; } @@ -467,16 +468,16 @@ fn render_text(entries: &[OutdatedEntry], console: &mozart_core::console::Consol let (name_str, lat_str) = match entry.category { UpdateCategory::UpToDate => ( - mozart_core::console::info(&name_col).to_string(), - mozart_core::console::info(&lat_col).to_string(), + console_format!("{name_col}"), + console_format!("{lat_col}"), ), UpdateCategory::SemverCompatible => ( - mozart_core::console::highlight(&name_col).to_string(), - mozart_core::console::highlight(&lat_col).to_string(), + console_format!("{name_col}"), + console_format!("{lat_col}"), ), UpdateCategory::SemverIncompatible => ( - mozart_core::console::comment(&name_col).to_string(), - mozart_core::console::comment(&lat_col).to_string(), + console_format!("{name_col}"), + console_format!("{lat_col}"), ), }; @@ -485,7 +486,7 @@ fn render_text(entries: &[OutdatedEntry], console: &mozart_core::console::Consol &format!( "{} {} {} {}", name_str, - mozart_core::console::comment(&cur_col), + console_format!("{cur_col}"), lat_str, entry.description ), -- cgit v1.3.1