From bc0de9955c375cf27d52c9934403964205afc182 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 22:16:15 +0100 Subject: formatting --- src/client/ui.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/client/ui.rs') diff --git a/src/client/ui.rs b/src/client/ui.rs index 0fe78ae..4ab0759 100644 --- a/src/client/ui.rs +++ b/src/client/ui.rs @@ -94,10 +94,7 @@ pub fn command_names() -> Vec<&'static str> { pub fn help_lines() -> Vec { let mut lines = vec!["Available commands:".to_string()]; for command in COMMANDS { - lines.push(format!( - " {:<28} - {}", - command.usage, command.description - )); + lines.push(format!(" {:<28} - {}", command.usage, command.description)); } lines } @@ -291,16 +288,12 @@ pub fn host_lines(hosts: &[(String, Option)]) -> Vec { /// on the current line. `render()` has no trailing newline, so a 7-line board /// needs `MoveUp(6)`. pub fn lines_to_move_up(previous_lines: usize) -> u16 { - previous_lines - .saturating_sub(1) - .min(u16::MAX as usize) as u16 + previous_lines.saturating_sub(1).min(u16::MAX as usize) as u16 } /// Column (0-based) to move to after the given prompt and input text. pub fn input_cursor_column(prompt_len: usize, input_len: usize) -> u16 { - prompt_len - .saturating_add(input_len) - .min(u16::MAX as usize) as u16 + prompt_len.saturating_add(input_len).min(u16::MAX as usize) as u16 } /// Number of terminal rows a block of logical lines occupies after wrapping. -- cgit v1.2.3