aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/process_executor.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/process_executor.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/process_executor.rs')
-rw-r--r--crates/shirabe/src/util/process_executor.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs
index 61fc0a1..1f15795 100644
--- a/crates/shirabe/src/util/process_executor.rs
+++ b/crates/shirabe/src/util/process_executor.rs
@@ -14,8 +14,8 @@ use shirabe_external_packages::symfony::process::exception::RuntimeException as
use shirabe_php_shim::{
LogicException, PhpMixed, RuntimeException, array_intersect, array_map, call_user_func,
defined, escapeshellarg, explode, implode, in_array, is_array, is_callable, is_dir, is_numeric,
- is_string, max, min, rtrim, sprintf, str_replace, strcspn, strlen, strpbrk, strtolower,
- strtr_array, substr_replace, trim, usleep,
+ is_string, rtrim, sprintf, str_replace, strcspn, strlen, strpbrk, strtolower, strtr_array,
+ substr_replace, trim, usleep,
};
use crate::io::IOInterface;
@@ -540,13 +540,12 @@ impl ProcessExecutor {
None => PhpMixed::Null,
};
if is_numeric(&max_jobs_env_mixed) {
- self.max_jobs = max(
- 1,
- min(
- 50,
- max_jobs_env.as_deref().unwrap_or("0").parse().unwrap_or(0),
- ),
- );
+ self.max_jobs = max_jobs_env
+ .as_deref()
+ .unwrap_or("0")
+ .parse()
+ .unwrap_or(0)
+ .clamp(1, 50);
} else {
self.max_jobs = 10;
}