Fix formatting: break long lines for rustfmt compliance

Rustfmt requires long chained method calls to be broken across
multiple lines when they exceed line length limits.

Changes:
- Break visual_width() iterator chains in renderer.rs
- Break visual_width() iterator chains in terminal.rs
- Fix comment alignment in ansi.rs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-09 04:24:40 +01:00
parent 70093c82d7
commit 0a75003451
3 changed files with 11 additions and 3 deletions

View File

@@ -62,7 +62,11 @@ impl<'a> Renderer<'a> {
let (width, height) = terminal.get_size();
let lines: Vec<&str> = colored_text.lines().collect();
let text_height = lines.len() as i32;
let text_width = lines.iter().map(|l| ansi::visual_width(l)).max().unwrap_or(0) as i32;
let text_width = lines
.iter()
.map(|l| ansi::visual_width(l))
.max()
.unwrap_or(0) as i32;
let base_x = (width as i32 - text_width) / 2;
let base_y = (height as i32 - text_height) / 2;

View File

@@ -69,7 +69,11 @@ impl TerminalManager {
pub fn print_centered(&self, text: &str) -> Result<()> {
let lines: Vec<&str> = text.lines().collect();
let max_width = lines.iter().map(|l| ansi::visual_width(l)).max().unwrap_or(0) as u16;
let max_width = lines
.iter()
.map(|l| ansi::visual_width(l))
.max()
.unwrap_or(0) as u16;
let height = lines.len() as u16;
let start_x = (self.width.saturating_sub(max_width)) / 2;