summaryrefslogtreecommitdiff
path: root/common/rust/aoc/src/lib.rs
diff options
context:
space:
mode:
authorcos <cos>2021-12-01 09:55:47 +0100
committercos <cos>2021-12-01 09:55:47 +0100
commitbd71657aaadb45b75d4bb847232fe688892e3404 (patch)
treed42312fb393c53d7f3dc20416ba79bd4a9e9e927 /common/rust/aoc/src/lib.rs
parentfe601d453f8b4c00dc12fd8945be0efffe9f8165 (diff)
downloadadventofcode-bd71657aaadb45b75d4bb847232fe688892e3404.zip
Copy common lib out of year specific directory
Diffstat (limited to 'common/rust/aoc/src/lib.rs')
-rw-r--r--common/rust/aoc/src/lib.rs13
1 files changed, 13 insertions, 0 deletions
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)
+ }
+}