Even better way to have different return types, also added script to setup template

This commit is contained in:
2022-12-06 01:26:17 +01:00
parent 5554cfedb3
commit ee9dcc92c1
9 changed files with 87 additions and 102 deletions

View File

@@ -1,5 +1,5 @@
use anyhow::Result;
use aoc::{Solver, Output};
use aoc::Solver;
// -- Runners --
fn main() -> Result<()> {
@@ -12,22 +12,23 @@ mod tests {
#[test]
fn part1_test1() -> Result<()> {
Day::test(aoc::Part::ONE, "test-1", Output::Number(0))
Day::test(aoc::Part::ONE, "test-1", TEST)
}
}
// -- Solution --
pub struct Day;
impl aoc::Solver for Day {
type Output = TYPE;
fn day() -> u8 {
todo!("Day not set")
DAY
}
fn part1(input: &str) -> Output {
Output::Number(0)
fn part1(input: &str) -> Self::Output {
DEFAULT
}
fn part2(input: &str) -> Output {
Output::Number(0)
fn part2(input: &str) -> Self::Output {
DEFAULT
}
}