o i am too structured huh

master
bel 2024-05-06 22:10:56 -06:00
parent ad9c32c987
commit 5a75b3e5f2
1 changed files with 25 additions and 1 deletions

View File

@ -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<When>,
pub detail: Option<String>,
pub sub: Vec<Task>,
}
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
}
}