aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/http
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/http
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/http')
-rw-r--r--crates/shirabe/src/util/http/curl_downloader.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs
index 42153eb..0519f26 100644
--- a/crates/shirabe/src/util/http/curl_downloader.rs
+++ b/crates/shirabe/src/util/http/curl_downloader.rs
@@ -19,8 +19,8 @@ use shirabe_php_shim::{
curl_multi_add_handle, curl_multi_exec, curl_multi_info_read, curl_multi_init,
curl_multi_select, curl_multi_setopt, curl_setopt, curl_setopt_array, curl_share_init,
curl_share_setopt, curl_strerror, curl_version, defined, explode, fclose, fopen,
- function_exists, implode, in_array, ini_get, is_resource, json_decode, max, parse_url,
- preg_quote, rename, rewind, rtrim, sprintf, str_contains, stream_get_contents,
+ function_exists, implode, in_array, ini_get, is_resource, json_decode, parse_url, preg_quote,
+ rename, rewind, rtrim, sprintf, str_contains, stream_get_contents,
stream_get_contents_with_max, stripos, strpos, substr, unlink_silent, usleep, var_export,
};
@@ -369,14 +369,14 @@ impl CurlDownloader {
curl_setopt(
&curl_handle,
CURLOPT_TIMEOUT,
- PhpMixed::Int(max(
+ PhpMixed::Int(
ini_get("default_socket_timeout")
.as_deref()
.unwrap_or("0")
.parse::<i64>()
- .unwrap_or(0),
- 300,
- )),
+ .unwrap_or(0)
+ .max(300),
+ ),
);
curl_setopt(&curl_handle, CURLOPT_WRITEHEADER, header_handle.clone());
curl_setopt(&curl_handle, CURLOPT_FILE, body_handle.clone());