diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/rust/aoc/Cargo.toml | 5 | ||||
-rw-r--r-- | common/rust/aoc/src/lib.rs | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/common/rust/aoc/Cargo.toml b/common/rust/aoc/Cargo.toml new file mode 100644 index 0000000..6102898 --- /dev/null +++ b/common/rust/aoc/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "aoc" +version = "0.1.0" +authors = ["cos <cos>"] +edition = "2021" diff --git a/common/rust/aoc/src/lib.rs b/common/rust/aoc/src/lib.rs new file mode 100644 index 0000000..bd0c31e --- /dev/null +++ b/common/rust/aoc/src/lib.rs @@ -0,0 +1,13 @@ +use std::env; + +pub fn do_parts() -> (bool, bool) { + match env::var("AOC_PARTS") { + Ok(parts) => { + let do_part_1 = parts.contains('1'); + let do_part_2 = parts.contains('2'); + + (do_part_1, do_part_2) + }, + Err(_) => (true, true) + } +} |