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

9
aoc/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "aoc"
version = "0.1.0"
authors = ["Antoine Martin <antoine97.martin@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

6
aoc/src/lib.rs Normal file
View file

@ -0,0 +1,6 @@
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),+)))
}