pub mod day01; pub mod day02; pub mod day03; pub mod day04; pub mod day05; pub mod day06; pub mod day07; pub mod day08; pub mod day09; pub mod day10; pub mod day11; pub mod day12; pub mod day13; pub mod day14; pub mod day15; pub mod day16; pub mod day17; pub mod day18; pub mod day19; pub mod day20; pub mod day21; pub mod day22; pub mod day23; pub mod day24; pub mod day25; use crate::utils::{self, get_input}; use std::{error::Error, fmt::Display, time::SystemTime}; pub trait Solution { fn part1(&self, input: &mut Vec) -> Result, Box>; fn part2(&self, input: &mut Vec) -> Result, Box>; fn get_day(&self) -> u8; fn run(&self) -> Result> { let start_time = SystemTime::now(); let run = Run { part1: self.part1(get_input(self.get_day(), utils::InputType::Actual)?.as_mut())?, part2: self.part2(get_input(self.get_day(), utils::InputType::Actual)?.as_mut())?, day: self.get_day(), time: SystemTime::now().duration_since(start_time)?, }; Ok(run) } } pub struct Run { pub part1: Box, pub part2: Box, pub day: u8, pub time: core::time::Duration, } unsafe impl Send for Run {}