diff options
Diffstat (limited to 'crates/shirabe/src/downloader/gzip_downloader.rs')
| -rw-r--r-- | crates/shirabe/src/downloader/gzip_downloader.rs | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/crates/shirabe/src/downloader/gzip_downloader.rs b/crates/shirabe/src/downloader/gzip_downloader.rs index 4ea2a327..4ea8f3b9 100644 --- a/crates/shirabe/src/downloader/gzip_downloader.rs +++ b/crates/shirabe/src/downloader/gzip_downloader.rs @@ -22,7 +22,7 @@ use shirabe_php_shim::{ #[derive(Debug)] pub struct GzipDownloader { inner: FileDownloader, - cleanup_executed: IndexMap<String, bool>, + cleanup_executed: std::cell::RefCell<IndexMap<String, bool>>, } impl GzipDownloader { @@ -45,7 +45,7 @@ impl GzipDownloader { Some(filesystem), Some(process), ), - cleanup_executed: IndexMap::new(), + cleanup_executed: std::cell::RefCell::new(IndexMap::new()), } } @@ -69,20 +69,12 @@ impl ArchiveDownloader for GzipDownloader { &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, @@ -149,7 +141,7 @@ impl ArchiveDownloader for GzipDownloader { impl ChangeReportInterface for GzipDownloader { fn get_local_changes( - &mut self, + &self, package: PackageInterfaceHandle, path: &str, ) -> anyhow::Result<Option<String>> { @@ -163,14 +155,12 @@ impl crate::downloader::DownloaderInterface for GzipDownloader { 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>, @@ -182,7 +172,7 @@ impl crate::downloader::DownloaderInterface for GzipDownloader { } async fn prepare( - &mut self, + &self, r#type: &str, package: PackageInterfaceHandle, path: &str, @@ -192,7 +182,7 @@ impl crate::downloader::DownloaderInterface for GzipDownloader { } async fn install( - &mut self, + &self, package: PackageInterfaceHandle, path: &str, output: bool, @@ -201,7 +191,7 @@ impl crate::downloader::DownloaderInterface for GzipDownloader { } async fn update( - &mut self, + &self, initial: PackageInterfaceHandle, target: PackageInterfaceHandle, path: &str, @@ -210,7 +200,7 @@ impl crate::downloader::DownloaderInterface for GzipDownloader { } async fn remove( - &mut self, + &self, package: PackageInterfaceHandle, path: &str, output: bool, @@ -219,7 +209,7 @@ impl crate::downloader::DownloaderInterface for GzipDownloader { } async fn cleanup( - &mut self, + &self, r#type: &str, package: PackageInterfaceHandle, path: &str, |
