aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/no_proxy_pattern.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-20 01:16:50 +0900
committernsfisis <nsfisis@gmail.com>2026-06-20 02:22:41 +0900
commitefec43b3b8827820cf35fe1b73d8e33f5fe84eb4 (patch)
treea62bbba72324de48be5f8e689559f8d9e288fc61 /crates/shirabe/src/util/no_proxy_pattern.rs
parentcac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 (diff)
downloadphp-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.gz
php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.zst
php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.zip
refactor: auto-fix clippy warnings
Diffstat (limited to 'crates/shirabe/src/util/no_proxy_pattern.rs')
-rw-r--r--crates/shirabe/src/util/no_proxy_pattern.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/shirabe/src/util/no_proxy_pattern.rs b/crates/shirabe/src/util/no_proxy_pattern.rs
index 512b881..34491ba 100644
--- a/crates/shirabe/src/util/no_proxy_pattern.rs
+++ b/crates/shirabe/src/util/no_proxy_pattern.rs
@@ -135,7 +135,7 @@ impl NoProxyPattern {
matched = rule_ipdata.ip == url_ipdata.ip;
} else {
// Match host and port
- let haystack = substr(&url.name, -(strlen(&rule.name) as i64), None);
+ let haystack = substr(&url.name, -strlen(&rule.name), None);
matched = stripos(&haystack, &rule.name) == Some(0);
}
@@ -260,7 +260,7 @@ impl NoProxyPattern {
// Check for a CIDR prefix-length
if strpos(&host, "/").is_some() {
let parts = explode("/", &host);
- host = parts.get(0).cloned().unwrap_or_default();
+ host = parts.first().cloned().unwrap_or_default();
let prefix_str = parts.get(1).cloned().unwrap_or_default();
if !allow_prefix || !self.validate_int(&prefix_str, 0, 128) {
@@ -446,7 +446,7 @@ impl NoProxyPattern {
// Check for square-bracket notation
// PHP: if ($hostName[0] === '[')
- if host_name.chars().next() == Some('[') {
+ if host_name.starts_with('[') {
let index = strpos(&host_name, "]");
// The smallest ip6 address is ::