use aoc crate for common stuff
This commit is contained in:
parent
907e883d48
commit
64410f0042
18 changed files with 49 additions and 28 deletions
|
|
@ -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" }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use super::err;
|
||||
use super::Result;
|
||||
use aoc::err;
|
||||
use aoc::Result;
|
||||
|
||||
const INPUT: &str = include_str!("../input/day01.txt");
|
||||
|
||||
|
|
|
|||
|
|
@ -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),+)))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue