From e41e6c8bc72e3300a0fa137f198454341bc315b1 Mon Sep 17 00:00:00 2001 From: mathiasmagnusson Date: Fri, 9 Dec 2022 18:00:02 +0100 Subject: Add aoc --- aoc22/lib/Cargo.toml | 8 ++++++++ aoc22/lib/src/lib.rs | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 aoc22/lib/Cargo.toml create mode 100644 aoc22/lib/src/lib.rs (limited to 'aoc22/lib') diff --git a/aoc22/lib/Cargo.toml b/aoc22/lib/Cargo.toml new file mode 100644 index 0000000..fb430d0 --- /dev/null +++ b/aoc22/lib/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "lib" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/aoc22/lib/src/lib.rs b/aoc22/lib/src/lib.rs new file mode 100644 index 0000000..ffe4e46 --- /dev/null +++ b/aoc22/lib/src/lib.rs @@ -0,0 +1,9 @@ +use std::fs; + +pub mod prelude { + pub use std::error::Error; +} + +pub fn read_input(day: usize) -> String { + fs::read_to_string(format!("day{}/input", day)).expect("Could not read input") +} -- cgit v1.2.3