From 6e81bd61f59317659395fab5413761f7d5605608 Mon Sep 17 00:00:00 2001 From: daladim Date: Sun, 28 Feb 2021 00:16:55 +0100 Subject: [PATCH] [doc] --- src/task.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/task.rs b/src/task.rs index c80037d..21ff5ca 100644 --- a/src/task.rs +++ b/src/task.rs @@ -1,7 +1,6 @@ use std::fmt::{Display, Formatter}; use chrono::{Utc, DateTime}; - use serde::{Deserialize, Serialize}; // TODO: turn into this one day @@ -26,9 +25,15 @@ impl Display for TaskId { /// A to-do task #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Task { + /// The task unique ID, that will never change id: TaskId, - name: String, + + /// The last modification date of this task last_modified: DateTime, + + /// The display name of the task + name: String, + /// The completion of the task completed: bool, } @@ -36,9 +41,10 @@ impl Task { /// Create a new Task pub fn new(name: String, last_modified: DateTime) -> Self { Self { - name, last_modified, id: TaskId::new(), - completed: false + name, + last_modified, + completed: false, } }