From 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jun 2026 03:52:05 +0900 Subject: refactor: fix compiler warnings and clippy warnings --- crates/shirabe-php-shim/src/string.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'crates/shirabe-php-shim/src/string.rs') diff --git a/crates/shirabe-php-shim/src/string.rs b/crates/shirabe-php-shim/src/string.rs index 9a82fe8..97c6695 100644 --- a/crates/shirabe-php-shim/src/string.rs +++ b/crates/shirabe-php-shim/src/string.rs @@ -333,10 +333,8 @@ fn natcmp_compare_right(a: &[u8], ap: &mut usize, b: &[u8], bp: &mut usize) -> i if bias == 0 { bias = -1; } - } else if ca > cb { - if bias == 0 { - bias = 1; - } + } else if ca > cb && bias == 0 { + bias = 1; } *ap += 1; *bp += 1; @@ -613,14 +611,14 @@ pub fn rawurldecode(s: &str) -> String { let mut out: Vec = Vec::with_capacity(bytes.len()); let mut i = 0; while i < bytes.len() { - if bytes[i] == b'%' && i + 2 < bytes.len() { - if let (Some(h), Some(l)) = + if bytes[i] == b'%' + && i + 2 < bytes.len() + && let (Some(h), Some(l)) = (hex_digit_value(bytes[i + 1]), hex_digit_value(bytes[i + 2])) - { - out.push((h << 4) | l); - i += 3; - continue; - } + { + out.push((h << 4) | l); + i += 3; + continue; } out.push(bytes[i]); i += 1; -- cgit v1.3.1