aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/home_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/home_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/home_command.rs')
-rw-r--r--crates/shirabe/src/command/home_command.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/home_command.rs b/crates/shirabe/src/command/home_command.rs
index 673039a..c048bfd 100644
--- a/crates/shirabe/src/command/home_command.rs
+++ b/crates/shirabe/src/command/home_command.rs
@@ -9,6 +9,7 @@ use crate::command::{BaseCommand, BaseCommandData, HasBaseCommandData};
use crate::console::input::InputArgument;
use crate::console::input::InputOption;
use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::package::CompletePackageInterfaceHandle;
use crate::package::PackageInterface;
use crate::package::RootPackageInterface;
@@ -73,8 +74,9 @@ impl HomeCommand {
) -> Result<i64> {
let repos = self.initialize_repos()?;
// 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;
let mut return_code: i64 = 0;
let packages: Vec<String> = input
@@ -172,7 +174,7 @@ impl HomeCommand {
}
fn open_browser(&mut self, url: &str) {
- let mut process = ProcessExecutor::new(Some(self.get_io().clone_box()));
+ let mut process = ProcessExecutor::new(Some(self.get_io().clone()));
if Platform::is_windows() {
let _ = process.execute(
PhpMixed::from(vec!["start", "\"web\"", "explorer", url]),