summaryrefslogtreecommitdiff
path: root/aoc22/lib
diff options
context:
space:
mode:
Diffstat (limited to 'aoc22/lib')
-rw-r--r--aoc22/lib/Cargo.toml8
-rw-r--r--aoc22/lib/src/lib.rs9
2 files changed, 17 insertions, 0 deletions
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")
+}