From 053f4ef153bf23d48a6c84338c3d43fd8b94666e Mon Sep 17 00:00:00 2001 From: Julius de Jeu Date: Thu, 2 Dec 2021 14:35:53 +0100 Subject: [PATCH] Add a warning when not running in december --- src/day02.rs | 2 +- src/main.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/day02.rs b/src/day02.rs index 725fe3a..74ec884 100644 --- a/src/day02.rs +++ b/src/day02.rs @@ -9,7 +9,7 @@ enum Instruction { } impl Day for Day02 { - fn init(content: String) -> Self where Self: Sized { + fn init(content: String) -> Self { let lines = content.split("\n").map(str_to_instr).collect::>(); Day02(lines) } diff --git a/src/main.rs b/src/main.rs index cfa220c..f00a020 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,10 @@ fn main() { run_day(&days, v as usize); } } else { - let v = chrono::Local::now().day(); - run_day(&days, v as usize) + let v = chrono::Local::now(); + if v.month() != 12 { + println!("This was really only meant to be used in december...") + } + run_day(&days, v.day() as usize) } }