From a1c7e6908a26e10f6e1f23a51721664b5e2d838d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 17 May 2026 02:53:53 +0900 Subject: chore(style): cargo fmt --- crates/shirabe/src/downloader/vcs_downloader.rs | 61 +++++++++++-------------- 1 file changed, 26 insertions(+), 35 deletions(-) (limited to 'crates/shirabe/src/downloader/vcs_downloader.rs') diff --git a/crates/shirabe/src/downloader/vcs_downloader.rs b/crates/shirabe/src/downloader/vcs_downloader.rs index 3fb305f..37954d2 100644 --- a/crates/shirabe/src/downloader/vcs_downloader.rs +++ b/crates/shirabe/src/downloader/vcs_downloader.rs @@ -4,9 +4,8 @@ use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::react::promise::promise_interface::PromiseInterface; use shirabe_php_shim::{ - array_map, array_shift, count, explode, get_class, implode, rawurldecode, realpath, - str_replace, strlen, strpos, substr, trim, InvalidArgumentException, PhpMixed, - RuntimeException, + InvalidArgumentException, PhpMixed, RuntimeException, array_map, array_shift, count, explode, + get_class, implode, rawurldecode, realpath, str_replace, strlen, strpos, substr, trim, }; use crate::config::Config; @@ -91,11 +90,7 @@ impl VcsDownloader { } if self.io.is_debug() { self.io.write_error( - PhpMixed::String(format!( - "Failed: [{}] {}", - get_class(&e), - e, - )), + PhpMixed::String(format!("Failed: [{}] {}", get_class(&e), e,)), true, IOInterface::NORMAL, ); @@ -183,7 +178,10 @@ impl VcsDownloader { } self.io.write_error( - PhpMixed::String(format!(" - {}: ", InstallOperation::format(package, false))), + PhpMixed::String(format!( + " - {}: ", + InstallOperation::format(package, false) + )), false, IOInterface::NORMAL, ); @@ -203,11 +201,7 @@ impl VcsDownloader { } if self.io.is_debug() { self.io.write_error( - PhpMixed::String(format!( - "Failed: [{}] {}", - get_class(&e), - e, - )), + PhpMixed::String(format!("Failed: [{}] {}", get_class(&e), e,)), true, IOInterface::NORMAL, ); @@ -285,11 +279,7 @@ impl VcsDownloader { } if self.io.is_debug() { self.io.write_error( - PhpMixed::String(format!( - "Failed: [{}] {}", - get_class(&e), - e, - )), + PhpMixed::String(format!("Failed: [{}] {}", get_class(&e), e,)), true, IOInterface::NORMAL, ); @@ -364,7 +354,10 @@ impl VcsDownloader { path: &str, ) -> Result> { self.io.write_error( - PhpMixed::String(format!(" - {}", UninstallOperation::format(package, false))), + PhpMixed::String(format!( + " - {}", + UninstallOperation::format(package, false) + )), true, IOInterface::NORMAL, ); @@ -372,24 +365,22 @@ impl VcsDownloader { let promise = self.filesystem.remove_directory_async(path); let path = path.to_string(); - Ok(promise.then(Box::new(move |result: PhpMixed| -> Result<()> { - let result_bool = result.as_bool().unwrap_or(false); - if !result_bool { - return Err(RuntimeException { - message: format!("Could not completely delete {}, aborting.", path), - code: 0, + Ok( + promise.then(Box::new(move |result: PhpMixed| -> Result<()> { + let result_bool = result.as_bool().unwrap_or(false); + if !result_bool { + return Err(RuntimeException { + message: format!("Could not completely delete {}, aborting.", path), + code: 0, + } + .into()); } - .into()); - } - Ok(()) - }))) + Ok(()) + })), + ) } - pub fn get_vcs_reference( - &self, - package: &dyn PackageInterface, - path: &str, - ) -> Option { + pub fn get_vcs_reference(&self, package: &dyn PackageInterface, path: &str) -> Option { let parser = VersionParser::new(); let guesser = VersionGuesser::new(&self.config, &self.process, &parser, &*self.io); let dumper = ArrayDumper::new(); -- cgit v1.3.1