diff --git a/src/deser/mod.rs b/src/deser/mod.rs index 7b2662e..278687f 100644 --- a/src/deser/mod.rs +++ b/src/deser/mod.rs @@ -34,11 +34,11 @@ fn limit_str(text: &str, length: usize) -> String { let mut new_length = length; let mut actual_length = 9999; let mut txt = text.to_owned(); - while actual_length > length { + while actual_length >= length { txt = txt.chars().take(new_length - 1).collect::(); actual_length = UnicodeWidthStr::width(txt.as_str()); new_length -= 1; } - format!("{}…", txt) + format!("{}…{}", txt, " ".repeat(length - actual_length - 1)) } }