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/http/curl_downloader.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/shirabe/src/util/http') 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::() - .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()); -- cgit v1.3.1