aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/require_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-26 20:04:02 +0900
committernsfisis <nsfisis@gmail.com>2026-05-26 20:04:02 +0900
commitf411daceacad66e0bd774fda7d3c5ef8533cc55c (patch)
treeeefb065e4d676a3f7031ca49bab21c773b00b134 /crates/shirabe/src/command/require_command.rs
parent1921f173ea219cb4b25847294d2d3fa465550fbb (diff)
downloadphp-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.gz
php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.zst
php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.zip
refactor(io): share IOInterface via Rc<RefCell<dyn _>> handle
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/require_command.rs')
-rw-r--r--crates/shirabe/src/command/require_command.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/shirabe/src/command/require_command.rs b/crates/shirabe/src/command/require_command.rs
index f0dce6b..66e1134 100644
--- a/crates/shirabe/src/command/require_command.rs
+++ b/crates/shirabe/src/command/require_command.rs
@@ -25,6 +25,7 @@ use crate::factory::Factory;
use crate::installer::Installer;
use crate::installer::InstallerEvents;
use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::json::JsonFile;
use crate::json::JsonManipulator;
use crate::package::base_package;
@@ -67,7 +68,7 @@ impl PackageDiscoveryTrait for RequireCommand {
todo!()
}
- fn get_io(&self) -> &dyn IOInterface {
+ fn get_io(&self) -> std::rc::Rc<std::cell::RefCell<dyn IOInterface>> {
todo!()
}
@@ -845,10 +846,12 @@ impl RequireCommand {
.borrow_mut()
.set_output_progress(!input.get_option("no-progress").as_bool().unwrap_or(false));
- // TODO(phase-b): Installer::create takes Box<dyn IOInterface> for ownership but io is a
+ // TODO(phase-b): Installer::create takes std::rc::Rc<std::cell::RefCell<dyn IOInterface>> for ownership but io is a
// borrowed &dyn here; needs Rc<dyn IOInterface> for proper sharing.
- let mut install =
- Installer::create(todo!("share io as Box<dyn IOInterface>"), &composer_handle);
+ let mut install = Installer::create(
+ todo!("share io as std::rc::Rc<std::cell::RefCell<dyn IOInterface>>"),
+ &composer_handle,
+ );
let (prefer_source, prefer_dist) =
self.get_preferred_install_options(&*composer.get_config().borrow(), input, false)?;