aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/no_proxy_pattern.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-21 17:02:52 +0900
committernsfisis <nsfisis@gmail.com>2026-06-21 17:12:37 +0900
commit84fe6ac6977f15cbec85cbc9f773567742a7fb87 (patch)
tree5701e7c980585dd404471ab9fa53e98a0ba601ab /crates/shirabe/src/util/no_proxy_pattern.rs
parent12a7756588a20f1351e6976f0c009de5992514a9 (diff)
downloadphp-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.tar.gz
php-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.tar.zst
php-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.zip
refactor(math): use method-style max/min/clamp over std::cmp
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 ed93414..08cd92f 100644
--- a/crates/shirabe/src/util/no_proxy_pattern.rs
+++ b/crates/shirabe/src/util/no_proxy_pattern.rs
@@ -6,8 +6,8 @@ use shirabe_external_packages::composer::pcre::Preg;
use shirabe_php_shim::{
FILTER_VALIDATE_INT, FILTER_VALIDATE_IP, PHP_URL_HOST, PHP_URL_PORT, PHP_URL_SCHEME, PhpMixed,
RuntimeException, array_key_exists, chr, empty, explode, filter_var, filter_var_with_options,
- floor, inet_pton, ltrim, parse_url, str_pad, str_repeat, stripos, strlen, strpbrk, strpos,
- substr, substr_count, unpack,
+ inet_pton, ltrim, parse_url, str_pad, str_repeat, stripos, strlen, strpbrk, strpos, substr,
+ substr_count, unpack,
};
/// Tests URLs against NO_PROXY patterns
@@ -314,7 +314,7 @@ impl NoProxyPattern {
fn ip_get_mask(&self, prefix: i64, size: i64) -> Vec<u8> {
let mut mask = String::new();
- let ones = floor(prefix as f64 / 8.0) as i64;
+ let ones = (prefix as f64 / 8.0).floor() as i64;
if ones != 0 {
mask = str_repeat(&chr(255), ones as usize);
}