Skip to content

Commit

Permalink
fix: fix merge conflicts with main
Browse files Browse the repository at this point in the history
  • Loading branch information
fspoettel committed Dec 5, 2023
1 parent 8fa7edb commit 11e9f86
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
/// Use the optional, second parameter, to only solve one specific part in isolation.
#[macro_export]
macro_rules! solution {
($day:expr) => {
Expand All @@ -47,17 +49,19 @@ macro_rules! solution {
run_part(part_two, &input, DAY, 2);
}
};
($day:expr, 1) => { /// Allows solving part one in isolation
const DAY: advent_of_code::Day = advent_of_code::day!($day);
($day:expr, 1) => {
/// Allows solving part one in isolation
const DAY: advent_of_code::template::Day = advent_of_code::day!($day);

fn main() {
use advent_of_code::template::runner::*;
let input = advent_of_code::template::read_file("inputs", DAY);
run_part(part_one, &input, DAY, 1);
}
};
($day:expr, 2) => { /// Allows solving part two in isolation
const DAY: advent_of_code::Day = advent_of_code::day!($day);
($day:expr, 2) => {
/// Allows solving part two in isolation
const DAY: advent_of_code::template::Day = advent_of_code::day!($day);

fn main() {
use advent_of_code::template::runner::*;
Expand Down

0 comments on commit 11e9f86

Please sign in to comment.