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 --- .../src/dependency_resolver/multi_conflict_rule.rs | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs') diff --git a/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs b/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs index 172b6f4..b15434e 100644 --- a/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs +++ b/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs @@ -1,9 +1,9 @@ //! ref: composer/src/Composer/DependencyResolver/MultiConflictRule.php -use anyhow::Result; -use shirabe_php_shim::{hash_raw, PHP_VERSION_ID, RuntimeException}; use crate::dependency_resolver::generic_rule::RuleLiterals; use crate::dependency_resolver::rule::Rule; +use anyhow::Result; +use shirabe_php_shim::{PHP_VERSION_ID, RuntimeException, hash_raw}; #[derive(Debug)] pub struct MultiConflictRule { @@ -12,12 +12,17 @@ pub struct MultiConflictRule { } impl MultiConflictRule { - pub fn new(mut literals: Vec, reason: shirabe_php_shim::PhpMixed, reason_data: shirabe_php_shim::PhpMixed) -> Result { + pub fn new( + mut literals: Vec, + reason: shirabe_php_shim::PhpMixed, + reason_data: shirabe_php_shim::PhpMixed, + ) -> Result { if literals.len() < 3 { return Err(RuntimeException { message: "multi conflict rule requires at least 3 literals".to_string(), code: 0, - }.into()); + } + .into()); } // sort all packages ascending by id @@ -34,8 +39,17 @@ impl MultiConflictRule { } pub fn get_hash(&self) -> Result { - let joined = self.literals.iter().map(|l| l.to_string()).collect::>().join(","); - let algo = if PHP_VERSION_ID > 80100 { "xxh3" } else { "sha1" }; + let joined = self + .literals + .iter() + .map(|l| l.to_string()) + .collect::>() + .join(","); + let algo = if PHP_VERSION_ID > 80100 { + "xxh3" + } else { + "sha1" + }; let binary = hash_raw(algo, &format!("c:{}", joined)); let data = shirabe_php_shim::unpack("ihash", &binary); match data { @@ -46,13 +60,15 @@ impl MultiConflictRule { Err(RuntimeException { message: format!("Failed unpacking: {}", joined), code: 0, - }.into()) + } + .into()) } } None => Err(RuntimeException { message: format!("Failed unpacking: {}", joined), code: 0, - }.into()), + } + .into()), } } -- cgit v1.3.1