aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-05-03 23:53:54 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-05-03 23:53:54 +0200
commit54c663c01a63521ec7959eceed96af1f3f98ecb5 (patch)
tree7b876f3592daf08478f412187036f6cd8ef675d3
parent13cdb0218c4ba9a0b531f41e49964704932d2510 (diff)
downloadmail-54c663c01a63521ec7959eceed96af1f3f98ecb5.tar.gz
add todo
-rw-r--r--src/window.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/window.rs b/src/window.rs
index a2f2b68..baabc30 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -18,6 +18,7 @@ pub enum Line {
}
pub fn truncate_dots(s: &str, to: usize) -> String {
+ //TODO We don't have time to do this every tick
let graphemes = s.graphemes(true).collect::<Vec<_>>();
if graphemes.len() >= to {
format!("{}...", graphemes.iter().take(to - 3).fold(String::new(), |acc, s| format!("{}{}", acc, s)))