about summary refs log tree commit diff
path: root/src/database.rs
diff options
context:
space:
mode:
authorRicky Kresslein <ricky@unobserved.io>2023-10-15 10:44:42 +0200
committerRicky Kresslein <ricky@unobserved.io>2023-10-15 10:44:42 +0200
commit5a21b2528e30706cba939fd38102cafa5100c783 (patch)
treeabd70d0c88111e1d381897d409d5ce7c155903f0 /src/database.rs
parent191b903380a8d9aeace8686c543b3fef5d16272d (diff)
downloadFurtherance-5a21b2528e30706cba939fd38102cafa5100c783.tar.zst
No longer show '#' for an empty tag in autocomplete
Diffstat (limited to 'src/database.rs')
-rw-r--r--src/database.rs6
1 files changed, 5 insertions, 1 deletions
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()
+        }
     }
 }