aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src
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
parent8cf9f977d90d0a8e8bfcb868a7ebcd4e1309c517 (diff)
downloadphp-shirabe-134acc52c0f339dd8bf96d4ffc508cdebe66b7d2.tar.gz
php-shirabe-134acc52c0f339dd8bf96d4ffc508cdebe66b7d2.tar.zst
php-shirabe-134acc52c0f339dd8bf96d4ffc508cdebe66b7d2.zip
chore: rustfmt
Diffstat (limited to 'crates/shirabe/src')
-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
-rw-r--r--crates/shirabe/src/installer/installation_manager.rs5
-rw-r--r--crates/shirabe/src/package/version/version_guesser.rs3
-rw-r--r--crates/shirabe/src/util/filesystem.rs4
7 files changed, 34 insertions, 12 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) {
diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs
index 906dac53..6c46754c 100644
--- a/crates/shirabe/src/installer/installation_manager.rs
+++ b/crates/shirabe/src/installer/installation_manager.rs
@@ -500,7 +500,10 @@ impl InstallationManager {
let package = package.clone();
let initial_package = initial_package.clone();
promises.push(Box::pin(async move {
- installer.download(package, initial_package).await.map(|_| ())
+ installer
+ .download(package, initial_package)
+ .await
+ .map(|_| ())
}));
}
}
diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs
index 349f08e1..185616ac 100644
--- a/crates/shirabe/src/package/version/version_guesser.rs
+++ b/crates/shirabe/src/package/version/version_guesser.rs
@@ -576,8 +576,7 @@ impl VersionGuesser {
},
&scm_cmdline,
);
- let process_future =
- self.process.borrow().execute_async(&cmd_line, Some(path));
+ let process_future = self.process.borrow().execute_async(&cmd_line, Some(path));
let mut process = sync_executor::block_on(process_future)?;
if !process.is_successful() {
continue;
diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs
index f3cb2e63..70bf69f7 100644
--- a/crates/shirabe/src/util/filesystem.rs
+++ b/crates/shirabe/src/util/filesystem.rs
@@ -905,7 +905,9 @@ impl Filesystem {
/// Hands out the executor handle itself so async callers can hold only a shared borrow
/// across their awaits (a RefMut held across an await panics once calls overlap).
- pub(crate) fn get_process_handle(&mut self) -> std::rc::Rc<std::cell::RefCell<ProcessExecutor>> {
+ pub(crate) fn get_process_handle(
+ &mut self,
+ ) -> std::rc::Rc<std::cell::RefCell<ProcessExecutor>> {
if self.process_executor.is_none() {
self.process_executor = Some(std::rc::Rc::new(std::cell::RefCell::new(
ProcessExecutor::new(None),