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) --- .../src/symfony/console/style/symfony_style.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/style') diff --git a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs index ce08f45..83229a9 100644 --- a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs @@ -61,7 +61,7 @@ impl SymfonyStyle { let w = Terminal::new().get_width(); if w != 0 { w } else { MAX_LINE_LENGTH } }; - let line_length = shirabe_php_shim::min( + let line_length = std::cmp::min( width - (std::path::MAIN_SEPARATOR == '\\') as i64, MAX_LINE_LENGTH, ); @@ -350,7 +350,7 @@ impl SymfonyStyle { &mut *self.get_formatter().borrow_mut(), &message, )); - let message_line_length = shirabe_php_shim::min( + let message_line_length = std::cmp::min( self.line_length - prefix_length - indent_length + decoration_length, self.line_length, ); @@ -392,14 +392,12 @@ impl SymfonyStyle { *line = format!("{}{}", prefix, line); line.push_str(&shirabe_php_shim::str_repeat( " ", - shirabe_php_shim::max( - self.line_length - - Helper::width(&Helper::remove_decoration( - &mut *self.output.borrow().get_formatter().borrow_mut(), - line, - )), - 0, - ) as usize, + (self.line_length + - Helper::width(&Helper::remove_decoration( + &mut *self.output.borrow().get_formatter().borrow_mut(), + line, + ))) + .max(0) as usize, )); if let Some(style) = style { -- cgit v1.3.1