Skip to content

Commit fb4ac26

Browse files
committed
Add macro arm for only running single part of days solution
1 parent 47e4f22 commit fb4ac26

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/template/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,22 @@ macro_rules! solution {
4545
run_part(part_two, &input, DAY, 2);
4646
}
4747
};
48+
($day:expr, 1) => { /// Allows solving part one in isolation
49+
const DAY: advent_of_code::Day = advent_of_code::day!($day);
50+
51+
fn main() {
52+
use advent_of_code::template::runner::*;
53+
let input = advent_of_code::template::read_file("inputs", DAY);
54+
run_part(part_one, &input, DAY, 1);
55+
}
56+
};
57+
($day:expr, 2) => { /// Allows solving part two in isolation
58+
const DAY: advent_of_code::Day = advent_of_code::day!($day);
59+
60+
fn main() {
61+
use advent_of_code::template::runner::*;
62+
let input = advent_of_code::template::read_file("inputs", DAY);
63+
run_part(part_two, &input, DAY, 2);
64+
}
65+
};
4866
}

0 commit comments

Comments
 (0)