diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-09 12:15:21 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-09 12:15:53 +0900 |
| commit | f18c18cd15f180b5067069ec6f10530515715f3d (patch) | |
| tree | 85ea3d3f10da9b32359dc3797fc7e6d262ae6752 /crates/mozart/src/commands/config.rs | |
| parent | f0192390ae1d89981f59395307e885a595f86eef (diff) | |
| download | php-mozart-f18c18cd15f180b5067069ec6f10530515715f3d.tar.gz php-mozart-f18c18cd15f180b5067069ec6f10530515715f3d.tar.zst php-mozart-f18c18cd15f180b5067069ec6f10530515715f3d.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/config.rs')
| -rw-r--r-- | crates/mozart/src/commands/config.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/crates/mozart/src/commands/config.rs b/crates/mozart/src/commands/config.rs index 58d593a..7227556 100644 --- a/crates/mozart/src/commands/config.rs +++ b/crates/mozart/src/commands/config.rs @@ -998,8 +998,10 @@ fn execute_read( for (key, value) in config.entries() { console_writeln!( console, - &format!("[{}] {}", key, render_value(&value)), mozart_core::console::Verbosity::Quiet, + "[{}] {}", + key, + render_value(&value), ); } return Ok(()); @@ -1019,8 +1021,9 @@ fn execute_read( if entry.get("name").and_then(|n| n.as_str()) == Some(repo_name) { console_writeln!( console, - &render_value(entry), mozart_core::console::Verbosity::Quiet, + "{}", + &render_value(entry), ); return Ok(()); } @@ -1035,8 +1038,9 @@ fn execute_read( if let Some(v) = get_nested(&raw, key) { console_writeln!( console, - &render_value(v), mozart_core::console::Verbosity::Quiet, + "{}", + &render_value(v), ); return Ok(()); } @@ -1049,8 +1053,9 @@ fn execute_read( if let Some(v) = raw.get(key.as_str()) { console_writeln!( console, - &render_value(v), mozart_core::console::Verbosity::Quiet, + "{}", + &render_value(v), ); return Ok(()); } @@ -1062,8 +1067,9 @@ fn execute_read( Some(value) => { console_writeln!( console, - &render_value(&value), mozart_core::console::Verbosity::Quiet, + "{}", + &render_value(&value), ); } None => { |
