Even better way to have different return types, also added script to setup template
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user