aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/phar_downloader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/downloader/phar_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/phar_downloader.rs34
1 files changed, 12 insertions, 22 deletions
diff --git a/crates/shirabe/src/downloader/phar_downloader.rs b/crates/shirabe/src/downloader/phar_downloader.rs
index 491f07e5..cbbb8252 100644
--- a/crates/shirabe/src/downloader/phar_downloader.rs
+++ b/crates/shirabe/src/downloader/phar_downloader.rs
@@ -18,7 +18,7 @@ use shirabe_php_shim::{Phar, PhpMixed};
#[derive(Debug)]
pub struct PharDownloader {
inner: FileDownloader,
- cleanup_executed: IndexMap<String, bool>,
+ cleanup_executed: std::cell::RefCell<IndexMap<String, bool>>,
}
impl PharDownloader {
@@ -41,7 +41,7 @@ impl PharDownloader {
Some(filesystem),
Some(process),
),
- cleanup_executed: IndexMap::new(),
+ cleanup_executed: std::cell::RefCell::new(IndexMap::new()),
}
}
}
@@ -51,20 +51,12 @@ impl ArchiveDownloader for PharDownloader {
&self.inner
}
- fn inner_mut(&mut self) -> &mut FileDownloader {
- &mut self.inner
- }
-
- fn cleanup_executed(&self) -> &IndexMap<String, bool> {
+ fn cleanup_executed(&self) -> &std::cell::RefCell<IndexMap<String, bool>> {
&self.cleanup_executed
}
- fn cleanup_executed_mut(&mut self) -> &mut IndexMap<String, bool> {
- &mut self.cleanup_executed
- }
-
async fn extract(
- &mut self,
+ &self,
_package: PackageInterfaceHandle,
file: &str,
path: &str,
@@ -83,7 +75,7 @@ impl ArchiveDownloader for PharDownloader {
impl ChangeReportInterface for PharDownloader {
fn get_local_changes(
- &mut self,
+ &self,
package: PackageInterfaceHandle,
path: &str,
) -> anyhow::Result<Option<String>> {
@@ -97,14 +89,12 @@ impl DownloaderInterface for PharDownloader {
self.inner.get_installation_source()
}
- fn as_change_report_interface(
- &mut self,
- ) -> Option<&mut dyn crate::downloader::ChangeReportInterface> {
+ fn as_change_report_interface(&self) -> Option<&dyn crate::downloader::ChangeReportInterface> {
Some(self)
}
async fn download(
- &mut self,
+ &self,
package: PackageInterfaceHandle,
path: &str,
prev_package: Option<PackageInterfaceHandle>,
@@ -116,7 +106,7 @@ impl DownloaderInterface for PharDownloader {
}
async fn prepare(
- &mut self,
+ &self,
r#type: &str,
package: PackageInterfaceHandle,
path: &str,
@@ -126,7 +116,7 @@ impl DownloaderInterface for PharDownloader {
}
async fn install(
- &mut self,
+ &self,
package: PackageInterfaceHandle,
path: &str,
output: bool,
@@ -135,7 +125,7 @@ impl DownloaderInterface for PharDownloader {
}
async fn update(
- &mut self,
+ &self,
initial: PackageInterfaceHandle,
target: PackageInterfaceHandle,
path: &str,
@@ -144,7 +134,7 @@ impl DownloaderInterface for PharDownloader {
}
async fn remove(
- &mut self,
+ &self,
package: PackageInterfaceHandle,
path: &str,
output: bool,
@@ -153,7 +143,7 @@ impl DownloaderInterface for PharDownloader {
}
async fn cleanup(
- &mut self,
+ &self,
r#type: &str,
package: PackageInterfaceHandle,
path: &str,