aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/remove.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-09 12:15:21 +0900
committernsfisis <nsfisis@gmail.com>2026-05-09 12:15:53 +0900
commitf18c18cd15f180b5067069ec6f10530515715f3d (patch)
tree85ea3d3f10da9b32359dc3797fc7e6d262ae6752 /crates/mozart/src/commands/remove.rs
parentf0192390ae1d89981f59395307e885a595f86eef (diff)
downloadphp-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/remove.rs')
-rw-r--r--crates/mozart/src/commands/remove.rs19
1 files changed, 4 insertions, 15 deletions
diff --git a/crates/mozart/src/commands/remove.rs b/crates/mozart/src/commands/remove.rs
index f2a841c..d4d727f 100644
--- a/crates/mozart/src/commands/remove.rs
+++ b/crates/mozart/src/commands/remove.rs
@@ -152,10 +152,7 @@ pub async fn execute(
if args.dev {
if composer.require_dev.contains_key(&name) {
- console_writeln!(
- console,
- &console_format!("<info>Removing {name} from require-dev</info>"),
- );
+ console_writeln!(console, "<info>Removing {name} from require-dev</info>");
composer.require_dev.remove(&name);
packages_removed.push(name);
} else {
@@ -164,17 +161,11 @@ pub async fn execute(
));
}
} else if composer.require.contains_key(&name) {
- console_writeln!(
- console,
- &console_format!("<info>Removing {name} from require</info>"),
- );
+ console_writeln!(console, "<info>Removing {name} from require</info>");
composer.require.remove(&name);
packages_removed.push(name);
} else if composer.require_dev.contains_key(&name) {
- console_writeln!(
- console,
- &console_format!("<info>Removing {name} from require-dev</info>"),
- );
+ console_writeln!(console, "<info>Removing {name} from require-dev</info>");
composer.require_dev.remove(&name);
packages_removed.push(name);
} else {
@@ -192,9 +183,7 @@ pub async fn execute(
if args.no_update {
console_writeln!(
console,
- &console_format!(
- "<comment>Not updating dependencies, only modifying composer.json.</comment>"
- ),
+ "<comment>Not updating dependencies, only modifying composer.json.</comment>"
);
return Ok(());
}