aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/status_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/status_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/status_command.rs')
-rw-r--r--crates/shirabe/src/command/status_command.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/shirabe/src/command/status_command.rs b/crates/shirabe/src/command/status_command.rs
index 69c36a1..182dec8 100644
--- a/crates/shirabe/src/command/status_command.rs
+++ b/crates/shirabe/src/command/status_command.rs
@@ -87,8 +87,9 @@ impl StatusCommand {
let composer = self.require_composer(None, None)?;
let mut composer = crate::command::composer_full_mut(&composer);
// TODO(phase-b): release the &mut self borrow held by get_io via clone_box.
- 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;
let mut errors: IndexMap<String, String> = IndexMap::new();
let mut unpushed_changes: IndexMap<String, String> = IndexMap::new();
@@ -101,12 +102,16 @@ impl StatusCommand {
.borrow()
.get_process_executor()
.map(std::rc::Rc::clone)
- .unwrap_or_else(|| std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(io))));
+ .unwrap_or_else(|| {
+ std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(Some(
+ io_box.clone(),
+ ))))
+ });
let mut guesser = VersionGuesser::new(
composer.get_config(),
process_executor.clone(),
parser.clone(),
- Some(io_box.clone_box()),
+ Some(io_box.clone()),
);
let dumper = ArrayDumper::new();