use aoc crate for common stuff

This commit is contained in:
Antoine Martin 2019-12-01 22:22:12 +01:00
parent 907e883d48
commit 64410f0042
18 changed files with 49 additions and 28 deletions

View file

@ -7,3 +7,5 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
aoc = { path = "../aoc" }

View file

@ -1,5 +1,5 @@
use super::err;
use super::Result;
use aoc::err;
use aoc::Result;
const INPUT: &str = include_str!("../input/day01.txt");

View file

@ -1,8 +1 @@
pub mod day01;
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
#[macro_export]
macro_rules! err {
($($string:expr),+) => (Box::<dyn std::error::Error>::from(format!($($string),+)))
}

View file

@ -1,8 +1,8 @@
use std::env;
use aoc2015::day01;
use aoc::Result;
use aoc2015::Result;
use aoc2015::day01;
fn main() -> Result<()> {
let days: &[fn() -> Result<()>] = &[day01::run];