aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/util')
-rw-r--r--crates/shirabe/src/util/config_validator.rs5
-rw-r--r--crates/shirabe/src/util/git.rs2
-rw-r--r--crates/shirabe/src/util/hg.rs2
-rw-r--r--crates/shirabe/src/util/http/curl_downloader.rs4
-rw-r--r--crates/shirabe/src/util/http_downloader.rs3
-rw-r--r--crates/shirabe/src/util/remote_filesystem.rs4
-rw-r--r--crates/shirabe/src/util/svn.rs2
7 files changed, 11 insertions, 11 deletions
diff --git a/crates/shirabe/src/util/config_validator.rs b/crates/shirabe/src/util/config_validator.rs
index 47b4968..5621841 100644
--- a/crates/shirabe/src/util/config_validator.rs
+++ b/crates/shirabe/src/util/config_validator.rs
@@ -39,9 +39,8 @@ impl ConfigValidator {
let mut lax_valid = false;
let mut manifest: Option<IndexMap<String, PhpMixed>> = None;
- // TODO(phase-b): io type mismatch (&dyn IOInterface vs std::rc::Rc<std::cell::RefCell<dyn IOInterface>>)
- let mut json =
- JsonFile::new(file.to_string(), None, None).expect("config file path is always local");
+ let mut json = JsonFile::new(file.to_string(), None, Some(self.io.clone()))
+ .expect("config file path is always local");
let schema_result: anyhow::Result<()> = (|| -> anyhow::Result<()> {
manifest = Some(match json.read()? {
PhpMixed::Array(m) => m.into_iter().map(|(k, v)| (k, *v)).collect(),
diff --git a/crates/shirabe/src/util/git.rs b/crates/shirabe/src/util/git.rs
index 1f6fd0a..b2438c7 100644
--- a/crates/shirabe/src/util/git.rs
+++ b/crates/shirabe/src/util/git.rs
@@ -150,7 +150,7 @@ impl Git {
// Ensure we are allowed to use this URL by config
self.config.borrow_mut().prohibit_url_by_config(
url,
- Some(&*self.io.borrow()),
+ Some(self.io.clone()),
&IndexMap::new(),
)?;
diff --git a/crates/shirabe/src/util/hg.rs b/crates/shirabe/src/util/hg.rs
index 47e80e2..f5ee256 100644
--- a/crates/shirabe/src/util/hg.rs
+++ b/crates/shirabe/src/util/hg.rs
@@ -36,7 +36,7 @@ impl Hg {
) -> Result<()> {
self.config.borrow_mut().prohibit_url_by_config(
&url,
- Some(&*self.io.borrow()),
+ Some(self.io.clone()),
&indexmap::IndexMap::new(),
)?;
diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs
index 71c0b5a..b86564f 100644
--- a/crates/shirabe/src/util/http/curl_downloader.rs
+++ b/crates/shirabe/src/util/http/curl_downloader.rs
@@ -341,7 +341,7 @@ impl CurlDownloader {
{
self.config.borrow_mut().prohibit_url_by_config(
url,
- Some(&*self.io.borrow()),
+ Some(self.io.clone()),
&options,
)?;
}
@@ -1187,7 +1187,7 @@ impl CurlDownloader {
== Some("application/json")
{
HttpDownloader::output_warnings(
- &*self.io.borrow(),
+ self.io.clone(),
job.get("origin").and_then(|v| v.as_string()).unwrap_or(""),
&match json_decode(response_ref.inner.get_body().unwrap_or(""), true)? {
PhpMixed::Array(a) => a.into_iter().map(|(k, v)| (k, *v)).collect(),
diff --git a/crates/shirabe/src/util/http_downloader.rs b/crates/shirabe/src/util/http_downloader.rs
index 610bd3a..166f1f8 100644
--- a/crates/shirabe/src/util/http_downloader.rs
+++ b/crates/shirabe/src/util/http_downloader.rs
@@ -18,6 +18,7 @@ use crate::composer::ComposerHandle;
use crate::config::Config;
use crate::downloader::TransportException;
use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::package::version::VersionParser;
use crate::util::GetResult;
use crate::util::Platform;
@@ -689,7 +690,7 @@ impl HttpDownloader {
///
/// @param array{warning?: string, info?: string, warning-versions?: string, info-versions?: string, warnings?: array<array{versions: string, message: string}>, infos?: array<array{versions: string, message: string}>} $data
pub fn output_warnings(
- io: &dyn IOInterface,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
url: &str,
data: &IndexMap<String, PhpMixed>,
) -> Result<()> {
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs
index 9aa40bd..22f5ea2 100644
--- a/crates/shirabe/src/util/remote_filesystem.rs
+++ b/crates/shirabe/src/util/remote_filesystem.rs
@@ -292,7 +292,7 @@ impl RemoteFilesystem {
{
let _ = self.config.borrow_mut().prohibit_url_by_config(
&file_url,
- Some(&*self.io.borrow()),
+ Some(self.io.clone()),
&indexmap::IndexMap::new(),
);
}
@@ -338,7 +338,7 @@ impl RemoteFilesystem {
_ => IndexMap::new(),
};
let _ = HttpDownloader::output_warnings(
- &*self.io.borrow(),
+ self.io.clone(),
origin_url,
&parsed_map,
);
diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs
index 737e75d..7634b62 100644
--- a/crates/shirabe/src/util/svn.rs
+++ b/crates/shirabe/src/util/svn.rs
@@ -98,7 +98,7 @@ impl Svn {
// Ensure we are allowed to use this URL by config
self.config.borrow_mut().prohibit_url_by_config(
url,
- Some(&*self.io.borrow()),
+ Some(self.io.clone()),
&indexmap::IndexMap::new(),
)?;