diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-14 14:13:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-14 14:13:00 +0900 |
| commit | 430f59c1938b9e5da381365172ab788b54895ffc (patch) | |
| tree | 180ade07dadc7793a45839f42b5674d62bc5fc00 /crates/shirabe-php-shim | |
| parent | ba0a7f913b4b2a83d0c8862d657bdc867730a962 (diff) | |
| download | php-shirabe-430f59c1938b9e5da381365172ab788b54895ffc.tar.gz php-shirabe-430f59c1938b9e5da381365172ab788b54895ffc.tar.zst php-shirabe-430f59c1938b9e5da381365172ab788b54895ffc.zip | |
refactor: auto-fix clippy warnings
Diffstat (limited to 'crates/shirabe-php-shim')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 8 | ||||
| -rw-r--r-- | crates/shirabe-php-shim/src/preg.rs | 12 |
2 files changed, 10 insertions, 10 deletions
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<T, F>(_array: &[T], _callback: F) -> bool where F: Fn(&T) -> bool, { - _array.iter().all(|x| _callback(x)) + _array.iter().all(_callback) } pub fn array_any<T, F>(_array: &[T], _callback: F) -> bool where F: Fn(&T) -> bool, { - _array.iter().any(|x| _callback(x)) + _array.iter().any(_callback) } pub fn array_reduce<T, U, F>(_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<T: Clone + PartialEq>(_array1: &[T], _array2: &[T]) -> Vec<T> { @@ -2344,7 +2344,7 @@ pub fn array_map<T, U, F>(_callback: F, _array: &[T]) -> Vec<U> 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()) |
