From 5a75b3e5f2e1850383525d41edd1531b3a02a73f Mon Sep 17 00:00:00 2001 From: bel Date: Mon, 6 May 2024 22:10:56 -0600 Subject: [PATCH] o i am too structured huh --- pttodoer/src/main.rs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pttodoer/src/main.rs b/pttodoer/src/main.rs index e7a11a9..9710412 100644 --- a/pttodoer/src/main.rs +++ b/pttodoer/src/main.rs @@ -1,3 +1,27 @@ fn main() { - println!("Hello, world!"); + println!("{:?}", Task{todo: "x".to_string(), when: None, detail: None, sub: vec![]}) +} + +#[derive(Debug)] +struct Task { + pub todo: String, + pub when: Option, + pub detail: Option, + pub sub: Vec, +} + +impl Task { + fn is_due(&self) -> bool { + self.when.is_none() || self.when.clone().unwrap().is_due() + } +} + +#[derive(Debug, Clone)] +struct When(String); + +impl When { + fn is_due(&self) -> bool { + assert!(false); + false + } }