summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-03-05 19:06:40 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-03-07 21:50:29 +0100
commit22a63db2381c4466df953fc91a4b7ec1a9d30ce4 (patch)
treedd7be8b050f6ab3af1f79acdf8d1c9eb27be3f52
parent93386d25f097c7097df9148ff2e97cc27138817d (diff)
Fix: Do not print table if there is no data
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r--src/commands/util.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commands/util.rs b/src/commands/util.rs
index 3b63c1d..9221030 100644
--- a/src/commands/util.rs
+++ b/src/commands/util.rs
@@ -169,6 +169,10 @@ pub fn display_data<D: Display>(
data: Vec<Vec<D>>,
csv: bool,
) -> Result<()> {
+ if data.is_empty() {
+ return Ok(())
+ }
+
if csv {
use csv::WriterBuilder;
let mut wtr = WriterBuilder::new().from_writer(vec![]);