Skip to main content

gitkraft_tui/
utils.rs

1//! Shared TUI utility functions.
2
3/// Pad a string to `width` characters with trailing spaces.
4pub fn pad_right(s: &str, width: usize) -> String {
5    let char_count = s.chars().count();
6    if char_count >= width {
7        s.to_string()
8    } else {
9        format!("{}{}", s, " ".repeat(width - char_count))
10    }
11}