From 430f59c1938b9e5da381365172ab788b54895ffc Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 14 Jun 2026 14:13:00 +0900 Subject: refactor: auto-fix clippy warnings --- crates/shirabe-php-shim/src/lib.rs | 8 ++++---- crates/shirabe-php-shim/src/preg.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/shirabe-php-shim/src') diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 40b0060..2a6ecf6 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -2103,21 +2103,21 @@ pub fn array_all(_array: &[T], _callback: F) -> bool where F: Fn(&T) -> bool, { - _array.iter().all(|x| _callback(x)) + _array.iter().all(_callback) } pub fn array_any(_array: &[T], _callback: F) -> bool where F: Fn(&T) -> bool, { - _array.iter().any(|x| _callback(x)) + _array.iter().any(_callback) } pub fn array_reduce(_array: &[T], _callback: F, _initial: U) -> U where F: Fn(U, &T) -> U, { - _array.iter().fold(_initial, |acc, x| _callback(acc, x)) + _array.iter().fold(_initial, _callback) } pub fn array_intersect(_array1: &[T], _array2: &[T]) -> Vec { @@ -2344,7 +2344,7 @@ pub fn array_map(_callback: F, _array: &[T]) -> Vec where F: Fn(&T) -> U, { - _array.iter().map(|x| _callback(x)).collect() + _array.iter().map(_callback).collect() } impl Phar { diff --git a/crates/shirabe-php-shim/src/preg.rs b/crates/shirabe-php-shim/src/preg.rs index 330ed4d..1429f1c 100644 --- a/crates/shirabe-php-shim/src/preg.rs +++ b/crates/shirabe-php-shim/src/preg.rs @@ -508,12 +508,12 @@ fn single_match_map( for i in 0..group_count { let m = caps.get(i); - if !unmatched_as_null && m.is_none() { - if let Some(last) = last_participating { - if i > last { - break; - } - } + if !unmatched_as_null + && m.is_none() + && let Some(last) = last_participating + && i > last + { + break; } let value = if unmatched_as_null { m.map(|m| m.as_str().to_string()) -- cgit v1.3.1