From d5b313f388d424e60ae33ae58c1a65a65b24b8f1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 18:04:45 +0900 Subject: refactor(command): share Input/OutputInterface via Rc Convert InputInterface and OutputInterface parameters from &dyn/&mut dyn references to Rc> shared ownership across the command, console, and IO layers, matching the Phase C shared-ownership approach already used for IOInterface. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/command/check_platform_reqs_command.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/command/check_platform_reqs_command.rs') diff --git a/crates/shirabe/src/command/check_platform_reqs_command.rs b/crates/shirabe/src/command/check_platform_reqs_command.rs index 05f7e9b..7b50d25 100644 --- a/crates/shirabe/src/command/check_platform_reqs_command.rs +++ b/crates/shirabe/src/command/check_platform_reqs_command.rs @@ -51,19 +51,24 @@ impl CheckPlatformReqsCommand { pub fn execute( &mut self, - input: &dyn InputInterface, - _output: &dyn OutputInterface, + input: std::rc::Rc>, + _output: std::rc::Rc>, ) -> Result { let composer = self.require_composer(None, None)?; let mut composer = crate::command::composer_full_mut(&composer); let io = self.get_io(); - let no_dev = input.get_option("no-dev").as_bool().unwrap_or(false); + let no_dev = input + .borrow() + .get_option("no-dev") + .as_bool() + .unwrap_or(false); let mut requires: IndexMap> = IndexMap::new(); let mut remove_packages: Vec = vec![]; let installed_repo_base: crate::repository::RepositoryInterfaceHandle = if input + .borrow() .get_option("lock") .as_bool() .unwrap_or(false) @@ -242,6 +247,7 @@ impl CheckPlatformReqsCommand { } let format = input + .borrow() .get_option("format") .as_string() .unwrap_or("text") @@ -251,7 +257,12 @@ impl CheckPlatformReqsCommand { Ok(exit_code) } - fn print_table(&mut self, output: &dyn OutputInterface, results: &[CheckResult], format: &str) { + fn print_table( + &mut self, + output: std::rc::Rc>, + results: &[CheckResult], + format: &str, + ) { let io = self.get_io(); if format == "json" { -- cgit v1.3.1