chore: run fmt, update docstring

This commit is contained in:
Felix Spöttel 2023-12-05 22:54:32 +01:00
parent 6d22d33160
commit b91e7e0af1

View file

@ -34,6 +34,8 @@ pub fn read_file_part(folder: &str, day: Day, part: u8) -> String {
} }
/// Creates the constant `DAY` and sets up the input and runner for each part. /// Creates the constant `DAY` and sets up the input and runner for each part.
///
/// The optional, second parameter (1 or 2) allows you to only run a single part of the solution.
#[macro_export] #[macro_export]
macro_rules! solution { macro_rules! solution {
($day:expr) => { ($day:expr) => {
@ -47,7 +49,8 @@ macro_rules! solution {
run_part(part_two, &input, DAY, 2); run_part(part_two, &input, DAY, 2);
} }
}; };
($day:expr, 1) => { /// Allows solving part one in isolation ($day:expr, 1) => {
/// Allows solving part one in isolation
const DAY: advent_of_code::template::Day = advent_of_code::day!($day); const DAY: advent_of_code::template::Day = advent_of_code::day!($day);
fn main() { fn main() {
@ -56,7 +59,8 @@ macro_rules! solution {
run_part(part_one, &input, DAY, 1); run_part(part_one, &input, DAY, 1);
} }
}; };
($day:expr, 2) => { /// Allows solving part two in isolation ($day:expr, 2) => {
/// Allows solving part two in isolation
const DAY: advent_of_code::template::Day = advent_of_code::day!($day); const DAY: advent_of_code::template::Day = advent_of_code::day!($day);
fn main() { fn main() {