From 46845eff8d1398f35099a0ef914f77bcaf473287 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 10 May 2026 15:29:19 +0900 Subject: refactor(io): introduce IoInterface trait mirroring Composer IOInterface Add an `IoInterface` trait in mozart-core::console that mirrors `\Composer\IO\IOInterface`, implement it for `Console`, and switch commands, the auditor, and the suggested-packages reporter to accept the abstracted IO (typically `Arc>>` at the command boundary, `&dyn IoInterface` deeper down) instead of `&Console`. The console_writeln\!/write\! macros now go through `IoInterface::verbosity()` via the lock so any implementor works. --- crates/mozart/src/commands/completion.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/mozart/src/commands/completion.rs') diff --git a/crates/mozart/src/commands/completion.rs b/crates/mozart/src/commands/completion.rs index 7cae278..3622f07 100644 --- a/crates/mozart/src/commands/completion.rs +++ b/crates/mozart/src/commands/completion.rs @@ -1,6 +1,7 @@ use clap::Args; use clap::CommandFactory; use clap_complete::aot::Shell; +use mozart_core::console::IoInterface; #[derive(Args)] pub struct CompletionArgs { @@ -12,7 +13,7 @@ pub struct CompletionArgs { pub async fn execute( args: &CompletionArgs, _cli: &super::Cli, - _console: &mozart_core::console::Console, + _io: std::sync::Arc>>, ) -> anyhow::Result<()> { let shell = match args.shell { Some(s) => s, -- cgit v1.3.1