From 84fe6ac6977f15cbec85cbc9f773567742a7fb87 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 17:02:52 +0900 Subject: refactor(math): use method-style max/min/clamp over std::cmp Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/util/no_proxy_pattern.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/util/no_proxy_pattern.rs') 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 { 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); } -- cgit v1.3.1