improve list msgs perf, remove flags column

This commit is contained in:
Clément DOUIN
2021-01-18 11:57:53 +01:00
parent d392d71129
commit 5e948b5cc1
8 changed files with 82 additions and 76 deletions
+4 -8
View File
@@ -60,15 +60,11 @@ impl Cell {
let style_end = "\x1b[0m";
if col_size > 0 && self.printable_value_len() > col_size {
let col_size = self
.value
.char_indices()
.map(|(i, _)| i)
.nth(col_size)
.unwrap()
- 2;
let value: String = self.value.chars().collect::<Vec<_>>()[0..=col_size - 2]
.into_iter()
.collect();
String::from(style_begin + &self.value[0..=col_size] + "" + style_end)
String::from(style_begin + &value + "" + style_end)
} else {
let padding = if col_size == 0 {
"".to_string()