//! Utility functions for handlers

/// Truncate a string for display, replacing newlines and tabs with spaces
pub fn truncate_for_display(s: &str, max: usize) -> String {
    let s = s.replace(['\n', '\t'], " ");
    if s.len() <= max {
        s
    } else {
        format!("{}...", &s[..max.saturating_sub(3)])
    }
}
