From bf96f8292c0e9818c8b5fc8713ca7506e4338a49 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 6 May 2026 03:38:32 +0900 Subject: refactor(console): add write macros and migrate commands to use them --- crates/mozart/src/commands/dependency.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'crates/mozart/src/commands/dependency.rs') diff --git a/crates/mozart/src/commands/dependency.rs b/crates/mozart/src/commands/dependency.rs index 3b6f8c4..d0f2d48 100644 --- a/crates/mozart/src/commands/dependency.rs +++ b/crates/mozart/src/commands/dependency.rs @@ -10,6 +10,7 @@ use std::path::Path; use anyhow::Result; use mozart_core::console_format; +use mozart_core::console_writeln; /// Inputs for [`do_execute`], collected from the `depends` / `prohibits` CLI args. pub struct DoExecuteArgs<'a> { @@ -89,13 +90,13 @@ pub fn do_execute( if results.is_empty() { if inverted { - console.write_stdout( + console_writeln!( + console, &console_format!( "{} {} can be installed.", package, version.unwrap_or("") ), - mozart_core::console::Verbosity::Normal, ); return Ok(()); } @@ -647,9 +648,9 @@ fn sample_versions_from_constraint( /// Columns: package name | version | link description | link constraint pub fn print_table(results: &[DependencyResult], console: &mozart_core::console::Console) { if results.is_empty() { - console.write_stdout( + console_writeln!( + console, &format!("{}", mozart_core::console::info("No relationships found.")), - mozart_core::console::Verbosity::Normal, ); return; } @@ -680,7 +681,8 @@ pub fn print_table(results: &[DependencyResult], console: &mozart_core::console: if !seen.insert(key) { continue; } - console.write_stdout( + console_writeln!( + console, &format!( "{: