This commit is contained in:
2026-01-22 16:24:29 +01:00
parent 452cc87a57
commit a699022812
9 changed files with 973 additions and 14 deletions

33
autotodo/src/main.rs Normal file
View 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();
}