notes
This commit is contained in:
33
autotodo/src/main.rs
Normal file
33
autotodo/src/main.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use std::fs;
|
||||
use ron;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use chrono;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
enum Pattern {
|
||||
Yearly { doy: u32 },
|
||||
MonthlyOpt { dom: u32, months: Vec<chrono::Month> },
|
||||
Monthly { dom: u32 },
|
||||
Weekly { dow: u32 },
|
||||
Daily,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct Position {
|
||||
name: String,
|
||||
pattern: Pattern
|
||||
}
|
||||
|
||||
fn parse_patterns() {
|
||||
let f = fs::read_to_string("data/patterns.ron").expect("file should exist");
|
||||
let patterns: Vec<Position> = ron::from_str(&f).expect("file should follow proper ron syntax");
|
||||
dbg!(patterns);
|
||||
}
|
||||
|
||||
fn parse_notes() {
|
||||
|
||||
}
|
||||
|
||||
fn main() {
|
||||
parse_patterns();
|
||||
}
|
||||
Reference in New Issue
Block a user