aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/diagnose_command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command/diagnose_command.rs')
-rw-r--r--crates/shirabe/src/command/diagnose_command.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs
index 945d1e9..bcedf30 100644
--- a/crates/shirabe/src/command/diagnose_command.rs
+++ b/crates/shirabe/src/command/diagnose_command.rs
@@ -79,7 +79,7 @@ impl DiagnoseCommand {
output: &dyn OutputInterface,
) -> anyhow::Result<i64> {
let mut composer = self.try_composer(None, None);
- let io_boxed: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = self.get_io().clone();
+ let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> = self.get_io().clone();
let config: std::rc::Rc<std::cell::RefCell<Config>>;
if let Some(ref mut c) = composer {
@@ -104,7 +104,7 @@ impl DiagnoseCommand {
.map(std::rc::Rc::clone)
.unwrap_or_else(|| {
std::rc::Rc::new(std::cell::RefCell::new(ProcessExecutor::new(Some(
- io_boxed.clone(),
+ io.clone(),
))))
}),
);
@@ -112,14 +112,9 @@ impl DiagnoseCommand {
config = std::rc::Rc::new(std::cell::RefCell::new(Factory::create_config(None, None)?));
self.process = Some(std::rc::Rc::new(std::cell::RefCell::new(
- ProcessExecutor::new(Some(io_boxed.clone())),
+ ProcessExecutor::new(Some(io.clone())),
)));
}
- // TODO(phase-b): clone_box to release self borrow held by get_io.
- let io_box = self.get_io().clone();
- let io_ref = io_box.borrow();
- let io: &dyn IOInterface = &*io_ref;
-
let mut config_inner: IndexMap<String, Box<PhpMixed>> = IndexMap::new();
config_inner.insert("secure-http".to_string(), Box::new(PhpMixed::Bool(false)));
let mut secure_http_wrap: IndexMap<String, PhpMixed> = IndexMap::new();
@@ -130,12 +125,12 @@ impl DiagnoseCommand {
.merge(&secure_http_wrap, Config::SOURCE_COMMAND);
let _ = config.borrow_mut().prohibit_url_by_config(
"http://repo.packagist.org",
- Some(&NullIO::new()),
+ Some(std::rc::Rc::new(std::cell::RefCell::new(NullIO::new()))),
&IndexMap::new(),
);
self.http_downloader = Some(std::rc::Rc::new(std::cell::RefCell::new(
- Factory::create_http_downloader(io_box.clone(), &config, indexmap::IndexMap::new())?,
+ Factory::create_http_downloader(io.clone(), &config, indexmap::IndexMap::new())?,
)));
if strpos(file!(), "phar:") == Some(0) {