Setup for 2023
This commit is contained in:
50
2023/template.rs
Normal file
50
2023/template.rs
Normal file
@@ -0,0 +1,50 @@
|
||||
#![feature(test)]
|
||||
use anyhow::Result;
|
||||
use aoc::Solver;
|
||||
|
||||
// -- Runners --
|
||||
fn main() -> Result<()> {
|
||||
Day::solve()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn part1_test1() -> Result<()> {
|
||||
Day::test(Day::part1, "test-1", TEST)
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
extern crate test;
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part1_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(Day::part1, b)
|
||||
}
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part2_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(Day::part2, b)
|
||||
}
|
||||
}
|
||||
|
||||
// -- Solution --
|
||||
pub struct Day;
|
||||
impl aoc::Solver for Day {
|
||||
type Output1 = TYPE;
|
||||
type Output2 = TYPE;
|
||||
|
||||
fn day() -> u8 {
|
||||
DAY
|
||||
}
|
||||
|
||||
fn part1(input: &str) -> Self::Output1 {
|
||||
DEFAULT
|
||||
}
|
||||
|
||||
fn part2(input: &str) -> Self::Output2 {
|
||||
DEFAULT
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user