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-php-shim/src/math.rs | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'crates/shirabe-php-shim/src/math.rs') diff --git a/crates/shirabe-php-shim/src/math.rs b/crates/shirabe-php-shim/src/math.rs index ee9a76d..0d9090b 100644 --- a/crates/shirabe-php-shim/src/math.rs +++ b/crates/shirabe-php-shim/src/math.rs @@ -1,30 +1,6 @@ -pub fn max(a: i64, b: i64) -> i64 { - a.max(b) -} - -pub fn min(a: i64, b: i64) -> i64 { - a.min(b) -} - -pub fn abs(v: i64) -> i64 { - v.abs() -} - -pub fn floor(v: f64) -> f64 { - v.floor() -} - -pub fn ceil(v: f64) -> f64 { - v.ceil() -} - pub fn round(v: f64, precision: i64) -> f64 { // PHP's default mode is PHP_ROUND_HALF_UP (round half away from zero), // which matches Rust's f64::round. let factor = 10f64.powi(precision as i32); (v * factor).round() / factor } - -pub fn intdiv(a: i64, b: i64) -> i64 { - a / b -} -- cgit v1.3.1