From f18c18cd15f180b5067069ec6f10530515715f3d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 9 May 2026 12:15:21 +0900 Subject: refactor(console): accept format args directly in console_writeln! macros Eliminate the nested &console_format!(...) boilerplate at every call site by teaching console_writeln!, console_write!, console_writeln_error!, and console_write_error! to accept a format literal + variadic args directly, matching the println!/eprintln! ergonomics. Propagate the format string span into generated code so rustc errors point to the right location. Co-Authored-By: Claude Sonnet 4.6 --- crates/mozart/src/commands/licenses.rs | 72 +++++++++++++--------------------- 1 file changed, 27 insertions(+), 45 deletions(-) (limited to 'crates/mozart/src/commands/licenses.rs') diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs index 468fde7..394cc39 100644 --- a/crates/mozart/src/commands/licenses.rs +++ b/crates/mozart/src/commands/licenses.rs @@ -3,7 +3,6 @@ use indexmap::IndexMap; use mozart_core::composer::Composer; use mozart_core::console::Console; use mozart_core::console::hyperlink; -use mozart_core::console_format; use mozart_core::console_writeln; use mozart_core::package_info; use mozart_core::package_info::PackageUrls; @@ -273,18 +272,9 @@ fn render_text( } else { root_licenses.join(", ") }; - console_writeln!( - console, - &console_format!("Name: {root_pretty_name}"), - ); - console_writeln!( - console, - &console_format!("Version: {root_version}"), - ); - console_writeln!( - console, - &console_format!("Licenses: {license_display}"), - ); + console_writeln!(console, "Name: {root_pretty_name}"); + console_writeln!(console, "Version: {root_version}"); + console_writeln!(console, "Licenses: {license_display}"); console_writeln!(console, "Dependencies:"); console_writeln!(console, ""); @@ -307,13 +297,11 @@ fn render_text( console_writeln!( console, - &format!( - "{: