aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-18 18:51:01 +0900
committernsfisis <nsfisis@gmail.com>2026-07-18 18:51:01 +0900
commit134acc52c0f339dd8bf96d4ffc508cdebe66b7d2 (patch)
tree8e49a78301adf0ae75412fa820c69d4a1e6cc880 /crates/shirabe/src/downloader
parent8cf9f977d90d0a8e8bfcb868a7ebcd4e1309c517 (diff)
downloadphp-shirabe-134acc52c0f339dd8bf96d4ffc508cdebe66b7d2.tar.gz
php-shirabe-134acc52c0f339dd8bf96d4ffc508cdebe66b7d2.tar.zst
php-shirabe-134acc52c0f339dd8bf96d4ffc508cdebe66b7d2.zip
chore: rustfmt
Diffstat (limited to 'crates/shirabe/src/downloader')
-rw-r--r--crates/shirabe/src/downloader/archive_downloader.rs14
-rw-r--r--crates/shirabe/src/downloader/file_downloader.rs4
-rw-r--r--crates/shirabe/src/downloader/path_downloader.rs10
-rw-r--r--crates/shirabe/src/downloader/zip_downloader.rs6
4 files changed, 26 insertions, 8 deletions
diff --git a/crates/shirabe/src/downloader/archive_downloader.rs b/crates/shirabe/src/downloader/archive_downloader.rs
index 9f203517..6ddf29b6 100644
--- a/crates/shirabe/src/downloader/archive_downloader.rs
+++ b/crates/shirabe/src/downloader/archive_downloader.rs
@@ -36,7 +36,9 @@ pub trait ArchiveDownloader {
self.cleanup_executed()
.borrow_mut()
.shift_remove(&package.get_name());
- self.inner().prepare(r#type, package, path, prev_package).await
+ self.inner()
+ .prepare(r#type, package, path, prev_package)
+ .await
}
async fn cleanup(
@@ -49,7 +51,9 @@ pub trait ArchiveDownloader {
self.cleanup_executed()
.borrow_mut()
.insert(package.get_name(), true);
- self.inner().cleanup(r#type, package, path, prev_package).await
+ self.inner()
+ .cleanup(r#type, package, path, prev_package)
+ .await
}
/// @inheritDoc
@@ -108,7 +112,8 @@ pub trait ArchiveDownloader {
}
};
- self.inner().add_cleanup_path(package.clone(), &temporary_dir);
+ self.inner()
+ .add_cleanup_path(package.clone(), &temporary_dir);
// avoid cleaning up $path if installing in "." for eg create-project as we can not
// delete the directory we are currently in on windows
if !is_dir(path) || realpath(path) != Some(Platform::get_cwd(false).unwrap_or_default()) {
@@ -189,7 +194,8 @@ pub trait ArchiveDownloader {
Filesystem::remove_directory_async_via(&self.inner().filesystem, &temporary_dir)
.await?;
- self.inner().remove_cleanup_path(package.clone(), &temporary_dir);
+ self.inner()
+ .remove_cleanup_path(package.clone(), &temporary_dir);
self.inner().remove_cleanup_path(package, path);
Ok(None)
diff --git a/crates/shirabe/src/downloader/file_downloader.rs b/crates/shirabe/src/downloader/file_downloader.rs
index 9742fd70..cbf008c4 100644
--- a/crates/shirabe/src/downloader/file_downloader.rs
+++ b/crates/shirabe/src/downloader/file_downloader.rs
@@ -127,7 +127,9 @@ impl FileDownloader {
&& cache.borrow().gc_is_necessary()
{
// PHP: writeError('Running cache garbage collection', true, io_interface::VERY_VERBOSE)
- this.io.borrow().write_error("Running cache garbage collection");
+ this.io
+ .borrow()
+ .write_error("Running cache garbage collection");
let ttl = this
.config
.borrow_mut()
diff --git a/crates/shirabe/src/downloader/path_downloader.rs b/crates/shirabe/src/downloader/path_downloader.rs
index b799de5a..eac5a859 100644
--- a/crates/shirabe/src/downloader/path_downloader.rs
+++ b/crates/shirabe/src/downloader/path_downloader.rs
@@ -427,7 +427,10 @@ impl DownloaderInterface for PathDownloader {
Err(_e) => {
if allowed_strategies.contains(&Self::STRATEGY_MIRROR) {
if output {
- self.inner.io.borrow().write_error3("", true, io_interface::NORMAL);
+ self.inner
+ .io
+ .borrow()
+ .write_error3("", true, io_interface::NORMAL);
self.inner.io.borrow().write_error3(
" <error>Symlink failed, fallback to use mirroring!</error>",
true,
@@ -475,7 +478,10 @@ impl DownloaderInterface for PathDownloader {
}
if output {
- self.inner.io.borrow().write_error3("", true, io_interface::NORMAL);
+ self.inner
+ .io
+ .borrow()
+ .write_error3("", true, io_interface::NORMAL);
}
Ok(None)
diff --git a/crates/shirabe/src/downloader/zip_downloader.rs b/crates/shirabe/src/downloader/zip_downloader.rs
index c149505b..9fa68c53 100644
--- a/crates/shirabe/src/downloader/zip_downloader.rs
+++ b/crates/shirabe/src/downloader/zip_downloader.rs
@@ -285,7 +285,11 @@ impl ZipDownloader {
file: &str,
path: &str,
) -> anyhow::Result<Option<PhpMixed>> {
- let mut zip_archive = self.zip_archive_object.borrow_mut().take().unwrap_or_default();
+ let mut zip_archive = self
+ .zip_archive_object
+ .borrow_mut()
+ .take()
+ .unwrap_or_default();
let result: anyhow::Result<Option<PhpMixed>> = (|| {
let retval = if !file_exists(file) || filesize(file).is_none_or(|s| s == 0) {