Skip to content

Commit

Permalink
🐛 fix solution!
Browse files Browse the repository at this point in the history
  • Loading branch information
tguichaoua committed Dec 17, 2024
1 parent 0c0838b commit a40e84a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ pub fn read_file_part(folder: &str, day: Day, part: u8) -> String {
/// The optional, second parameter (1 or 2) allows you to only run a single part of the solution.
#[macro_export]
macro_rules! solution {
($day:expr) => {
$crate::solution!(@impl $crate::day!($day), [part_one, 1] [part_two, 2]);
};
($day:expr, 1) => {
$crate::solution!(@impl $crate::day!($day), [part_one, 1]);
};
($day:expr, 2) => {
$crate::solution!(@impl $crate::day!($day), [part_two, 2]);
};

() => {
$crate::solution!(@impl $crate::day_from_file_name!(), [part_one, 1] [part_two, 2]);
};
Expand All @@ -64,6 +54,16 @@ macro_rules! solution {
$crate::solution!(@impl $crate::day_from_file_name!(), [part_two, 2]);
};

($day:expr) => {
$crate::solution!(@impl $crate::day!($day), [part_one, 1] [part_two, 2]);
};
($day:expr, 1) => {
$crate::solution!(@impl $crate::day!($day), [part_one, 1]);
};
($day:expr, 2) => {
$crate::solution!(@impl $crate::day!($day), [part_two, 2]);
};

(@impl $day:expr, $( [$func:expr, $part:expr] )*) => {
/// The current day.
const DAY: $crate::template::Day = $day;
Expand Down

0 comments on commit a40e84a

Please sign in to comment.