From 2bece0e94a231315b05e9f0641ac0574c9d38e8f Mon Sep 17 00:00:00 2001 From: Daniel Vainsencher Date: Fri, 4 Nov 2022 10:14:21 -0400 Subject: [PATCH] Nicer error message when report.{}.columns and labels mismatch. --- src/task_report.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/task_report.rs b/src/task_report.rs index 660a8ec..9ca1911 100644 --- a/src/task_report.rs +++ b/src/task_report.rs @@ -220,6 +220,9 @@ impl TaskReportTable { } } } + let num_labels = self.labels.len(); + let num_columns = self.columns.len(); + assert!(num_labels == num_columns, "Must have the same number of labels (currently {}) and columns (currently {}). Compare their values as shown by \"task show report.{}.\" and fix your taskwarrior config.", num_labels, num_columns, report); Ok(()) }