Macro-ify benches and unify days list to one file

Also update README with new options.
This commit is contained in:
2025-12-03 01:22:09 -05:00
parent cdc0225ca8
commit 5433430628
5 changed files with 41 additions and 20 deletions

12
src/days.rs Normal file
View File

@@ -0,0 +1,12 @@
// Single source of truth for all implemented days
// Add new days here and they'll automatically be available in both the runner and benchmarks
#[macro_export]
macro_rules! all_days {
($macro_name:path) => {
$macro_name! {
1 => day01,
2 => day02,
}
};
}

View File

@@ -1,2 +1,3 @@
pub mod day01;
pub mod day02;
pub mod days;

View File

@@ -1,7 +1,7 @@
mod days;
mod runner;
pub mod day01;
pub mod day02;
use aoc::{day01, day02};
use clap::Parser;
use color_eyre::Result;
@@ -24,10 +24,7 @@ struct Args {
part: Option<u8>,
}
runner::days! {
1 => day01,
2 => day02,
}
all_days!(runner::days);
fn main() -> Result<()> {
color_eyre::install()?;