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/fund.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/mozart/src/commands/fund.rs') diff --git a/crates/mozart/src/commands/fund.rs b/crates/mozart/src/commands/fund.rs index 707e9ee..1f334b3 100644 --- a/crates/mozart/src/commands/fund.rs +++ b/crates/mozart/src/commands/fund.rs @@ -157,15 +157,15 @@ fn render_text(fundings: &BTreeMap>>, conso let mut prev: Option = None; for (vendor, url_map) in fundings { console_writeln!(console, ""); - console_writeln!(console, &console_format!("{vendor}")); + console_writeln!(console, "{vendor}"); for (url, packages) in url_map { let line = format!(" {}", packages.join(", ")); if prev.as_deref() != Some(line.as_str()) { - console_writeln!(console, &console_format!("{line}")); + console_writeln!(console, "{line}"); prev = Some(line); } let link = hyperlink(url, url, console.decorated); - console_writeln!(console, &format!(" {link}")); + console_writeln!(console, " {link}"); } } @@ -192,7 +192,7 @@ fn render_json( } else { fundings.serialize(&mut ser)?; } - console_writeln!(console, &String::from_utf8(ser.into_inner())?); + console_writeln!(console, "{}", &String::from_utf8(ser.into_inner())?); Ok(()) } -- cgit v1.3.1