Add value abbreviations (#407)

This commit is contained in:
JT
2021-12-03 10:07:44 +13:00
committed by GitHub
parent 687fefd791
commit 19766556f3
2 changed files with 31 additions and 3 deletions

View File

@ -164,7 +164,7 @@ impl Command for Table {
style: TextStyle::default_field(),
},
StyledString {
contents: v.into_string(", ", &config),
contents: v.into_abbreviated_string(&config),
style: TextStyle::default(),
},
])
@ -225,7 +225,7 @@ fn convert_to_table(
if headers.is_empty() {
// if header row is empty, this is probably a list so format it that way
row.push(("list".to_string(), item.into_string(", ", config)))
row.push(("list".to_string(), item.into_abbreviated_string(config)))
} else {
for header in headers.iter().skip(1) {
let result = match item {
@ -241,7 +241,7 @@ fn convert_to_table(
match result {
Ok(value) => row.push((
(&value.get_type()).to_string(),
value.into_string(", ", config),
value.into_abbreviated_string(config),
)),
Err(_) => row.push(("empty".to_string(), String::new())),
}