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 + } }