Trait advent_of_code_traits::MissingPartTwo
source · [−]pub trait MissingPartTwo<const DAY: u32> { }
Expand description
MissingPartTwo
is a marker trait to tell the compiler that your struct doesn’t impl Solution for Part2.
Implementing this is required in order to run only Part1 using SolutionRunner::run
without specifying which SolutionRunner impl to use manually.
Why? It’s to guide the specialization by ensuring that each impl is unique. See specialization
for more details.
struct AdventOfCode2021<const DAY: u32>;
impl<'a> Solution<'a, Day1, Part1> for AdventOfCode2021<Day1> {
// your solution to part 1
}
// add this to be able to .run() AdventOfCode2021::<Day25> without an implemention for Part2
impl MissingPartTwo<Day1> for AdventOfCode2021<Day1> {}
// ...
problem.run(&input);