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-external-packages/src/symfony/console/style | |
| 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-external-packages/src/symfony/console/style')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs | 18 |
1 files changed, 8 insertions, 10 deletions
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 { |
