o i am too structured huh
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user