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;