From 0a7500345120efd13f6662a99a4265622f209a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 9 Nov 2025 04:24:40 +0100 Subject: [PATCH] Fix formatting: break long lines for rustfmt compliance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/animation/renderer.rs | 6 +++++- src/utils/ansi.rs | 2 +- src/utils/terminal.rs | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/animation/renderer.rs b/src/animation/renderer.rs index 6feba70..5434b20 100644 --- a/src/animation/renderer.rs +++ b/src/animation/renderer.rs @@ -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; diff --git a/src/utils/ansi.rs b/src/utils/ansi.rs index 0c12d5f..53c387b 100644 --- a/src/utils/ansi.rs +++ b/src/utils/ansi.rs @@ -8,7 +8,7 @@ pub fn strip_ansi(text: &str) -> String { // Skip ANSI escape sequence if chars.peek() == Some(&'[') { chars.next(); // consume '[' - // Skip until we hit a letter (the command character) + // Skip until we hit a letter (the command character) while let Some(&c) = chars.peek() { chars.next(); if c.is_ascii_alphabetic() { diff --git a/src/utils/terminal.rs b/src/utils/terminal.rs index 14e5537..d7ad6f9 100644 --- a/src/utils/terminal.rs +++ b/src/utils/terminal.rs @@ -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;