From 5a21b2528e30706cba939fd38102cafa5100c783 Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Sun, 15 Oct 2023 10:44:42 +0200 Subject: No longer show '#' for an empty tag in autocomplete --- src/database.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/database.rs b/src/database.rs index 2f97d2d..98258bd 100644 --- a/src/database.rs +++ b/src/database.rs @@ -40,7 +40,11 @@ pub struct Task { impl ToString for Task { fn to_string(&self) -> String { - format!("{} #{}", self.task_name, self.tags) + if !self.tags.is_empty() { + format!("{} #{}", self.task_name, self.tags) + } else { + self.task_name.to_string() + } } } -- cgit 1.4.1