aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/json/json_manipulator.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/json/json_manipulator.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/json/json_manipulator.rs')
-rw-r--r--crates/shirabe/src/json/json_manipulator.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/shirabe/src/json/json_manipulator.rs b/crates/shirabe/src/json/json_manipulator.rs
index f5ad2cd..904ea7a 100644
--- a/crates/shirabe/src/json/json_manipulator.rs
+++ b/crates/shirabe/src/json/json_manipulator.rs
@@ -6,7 +6,7 @@ use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
use shirabe_php_shim::{
ArrayObject, InvalidArgumentException, LogicException, PhpMixed, StdClass, addcslashes,
array_key_exists, array_keys, array_reverse, count, empty, explode, implode, in_array,
- is_array, is_int, is_numeric, json_decode, max, preg_quote, rtrim, str_contains, str_repeat,
+ is_array, is_int, is_numeric, json_decode, preg_quote, rtrim, str_contains, str_repeat,
str_replace, strlen, strnatcmp, strpos, substr, trim, uksort,
};
@@ -351,7 +351,7 @@ impl JsonManipulator {
list_regex = Some(format!(
"{{{}^(?P<start>\\s*\\{{\\s*(?:(?&string)\\s*:\\s*(?&json)\\s*,\\s*)*?\"repositories\"\\s*:\\s*\\[\\s*((?&json)\\s*+,\\s*+){{{}}})(?P<repository>(?&object))(?P<end>.*)}}sx",
Self::DEFINES,
- max(0, i_val)
+ i_val.max(0)
));
}
@@ -1251,7 +1251,7 @@ impl JsonManipulator {
let list_skip_to_item_regex = format!(
"{{{}^(?P<start>\\[\\s*((?&json)\\s*+,\\s*?){{{}}})(?P<space_before_item>(\\s*))(?P<end>.*)}}sx",
Self::DEFINES,
- max(0, index)
+ index.max(0)
);
let value_capture = value.clone();