diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-21 17:02:52 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-21 17:12:37 +0900 |
| commit | 84fe6ac6977f15cbec85cbc9f773567742a7fb87 (patch) | |
| tree | 5701e7c980585dd404471ab9fa53e98a0ba601ab /crates/shirabe/src/command | |
| parent | 12a7756588a20f1351e6976f0c009de5992514a9 (diff) | |
| download | php-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/command')
| -rw-r--r-- | crates/shirabe/src/command/base_command.rs | 4 | ||||
| -rw-r--r-- | crates/shirabe/src/command/diagnose_command.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe/src/command/base_command.rs b/crates/shirabe/src/command/base_command.rs index 40253d4..c4bfaef 100644 --- a/crates/shirabe/src/command/base_command.rs +++ b/crates/shirabe/src/command/base_command.rs @@ -13,7 +13,7 @@ use shirabe_external_packages::symfony::console::input::InputInterface; use shirabe_external_packages::symfony::console::output::OutputInterface; use shirabe_php_shim::{ AsAny, InvalidArgumentException, LogicException, PhpMixed, RuntimeException, - UnexpectedValueException, count, explode, in_array, is_string, max, + UnexpectedValueException, count, explode, in_array, is_string, }; use std::cell::RefCell; use std::rc::Rc; @@ -590,7 +590,7 @@ impl BaseCommand for BaseCommandData { if Platform::is_windows() { width -= 1; } else { - width = max(80, width); + width = width.max(80); } width diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs index 304f26f..43e878d 100644 --- a/crates/shirabe/src/command/diagnose_command.rs +++ b/crates/shirabe/src/command/diagnose_command.rs @@ -16,8 +16,8 @@ use shirabe_php_shim::{ PHP_WINDOWS_VERSION_BUILD, PhpMixed, RuntimeException, count, curl_version, defined, disk_free_space, extension_loaded, file_exists, filter_var, function_exists, get_class, get_class_err, hash, implode, ini_get, ioncube_loader_iversion, ioncube_loader_version, - is_array, is_string, key, max, ob_get_clean, ob_start, phpinfo, reset, rtrim, sprintf, - str_contains, str_replace, str_starts_with, strpos, strstr, strtolower, trim, version_compare, + is_array, is_string, key, ob_get_clean, ob_start, phpinfo, reset, rtrim, sprintf, str_contains, + str_replace, str_starts_with, strpos, strstr, strtolower, trim, version_compare, }; use std::cell::RefCell; use std::rc::Rc; @@ -1141,9 +1141,9 @@ impl DiagnoseCommand { } // Apply exit code updates after io borrow ends if had_error { - self.exit_code = max(prev_exit_code, 2); + self.exit_code = prev_exit_code.max(2); } else if had_warning { - self.exit_code = max(prev_exit_code, 1); + self.exit_code = prev_exit_code.max(1); } } |
