diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-13 15:43:22 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-13 15:43:22 +0100 |
commit | d6040e32a610a792d1e5365a7643eb99fbb5a217 (patch) | |
tree | b5196885ae750852ad848edda714d48f4819e4b6 /src/util | |
parent | d7f90cabb0517a50a6c3dd702852770240566bfc (diff) | |
download | garage-d6040e32a610a792d1e5365a7643eb99fbb5a217.tar.gz garage-d6040e32a610a792d1e5365a7643eb99fbb5a217.zip |
cli: prettier table in garage stats
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/formater.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/util/formater.rs b/src/util/formater.rs index 95324f9a..2ea53ebb 100644 --- a/src/util/formater.rs +++ b/src/util/formater.rs @@ -1,4 +1,4 @@ -pub fn format_table(data: Vec<String>) { +pub fn format_table_to_string(data: Vec<String>) -> String { let data = data .iter() .map(|s| s.split('\t').collect::<Vec<_>>()) @@ -24,5 +24,9 @@ pub fn format_table(data: Vec<String>) { out.push('\n'); } - print!("{}", out); + out +} + +pub fn format_table(data: Vec<String>) { + print!("{}", format_table_to_string(data)); } |