diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-29 00:16:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-29 00:23:32 +0900 |
| commit | 7f83e785a77fbdbcada9c6714703d4e5801af82a (patch) | |
| tree | ef7debc5cbc91d521db4dc5a563807c486dafd22 /crates/shirabe/src/command/require_command.rs | |
| parent | 7715c98aaf3e3962cabbcf740e93fa817a2f8027 (diff) | |
| download | php-shirabe-7f83e785a77fbdbcada9c6714703d4e5801af82a.tar.gz php-shirabe-7f83e785a77fbdbcada9c6714703d4e5801af82a.tar.zst php-shirabe-7f83e785a77fbdbcada9c6714703d4e5801af82a.zip | |
refactor(io): unify IOInterface params to Rc<RefCell<dyn _>>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/require_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/require_command.rs | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/crates/shirabe/src/command/require_command.rs b/crates/shirabe/src/command/require_command.rs index 93ec469..f59d60f 100644 --- a/crates/shirabe/src/command/require_command.rs +++ b/crates/shirabe/src/command/require_command.rs @@ -553,17 +553,9 @@ impl RequireCommand { .borrow_mut() .deactivate_installed_plugins(); - // try/catch/finally - // TODO(phase-b): do_update borrows io from self while also needing &mut self for state - // mutations; needs an Rc<dyn IOInterface> on self for clean sharing. - let do_update_result = self.do_update( - input, - output, - todo!("share io reference for do_update"), - &requirements, - require_key, - remove_key, - ); + let io = self.get_io().clone(); + let do_update_result = + self.do_update(input, output, io, &requirements, require_key, remove_key); let dry_run = input.get_option("dry-run").as_bool().unwrap_or(false); let result = match do_update_result { @@ -682,7 +674,7 @@ impl RequireCommand { &mut self, input: &dyn InputInterface, output: &dyn OutputInterface, - io: &dyn IOInterface, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, requirements: &IndexMap<String, String>, require_key: &str, _remove_key: &str, @@ -848,12 +840,7 @@ impl RequireCommand { .borrow_mut() .set_output_progress(!input.get_option("no-progress").as_bool().unwrap_or(false)); - // 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 std::rc::Rc<std::cell::RefCell<dyn IOInterface>>"), - &composer_handle, - ); + let mut install = Installer::create(io.clone(), &composer_handle); let (prefer_source, prefer_dist) = self.get_preferred_install_options(&*composer.get_config().borrow(), input, false)?; |
