From f411daceacad66e0bd774fda7d3c5ef8533cc55c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 26 May 2026 20:04:02 +0900 Subject: refactor(io): share IOInterface via Rc> handle Co-Authored-By: Claude Opus 4.7 --- crates/shirabe/src/command/install_command.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/command/install_command.rs') diff --git a/crates/shirabe/src/command/install_command.rs b/crates/shirabe/src/command/install_command.rs index a0710dc..4c869f4 100644 --- a/crates/shirabe/src/command/install_command.rs +++ b/crates/shirabe/src/command/install_command.rs @@ -67,8 +67,9 @@ impl InstallCommand { output: &dyn OutputInterface, ) -> Result { // TODO(phase-b): clone_box to release self borrow held by get_io. - let io_box = self.get_io().clone_box(); - let io: &dyn IOInterface = io_box.as_ref(); + let io_box = self.get_io().clone(); + let io_ref = io_box.borrow(); + let io: &dyn IOInterface = &*io_ref; if input.get_option("dev").as_bool().unwrap_or(false) { io.write_error("You are using the deprecated option \"--dev\". It has no effect and will break in Composer 3."); @@ -114,7 +115,7 @@ impl InstallCommand { .borrow_mut() .dispatch(Some(command_event.get_name()), None); - let mut install = Installer::create(io.clone_box(), &composer_handle); + let mut install = Installer::create(io_box.clone(), &composer_handle); let config = composer.get_config(); let (prefer_source, prefer_dist) = -- cgit v1.3.1