From 61ca75696db30604ce89ed22558b64dffd41298a Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 23 Dec 2022 11:37:32 -0500 Subject: [PATCH] Use shared lib on day 9 --- day9/Cargo.lock | 7 +++++++ day9/Cargo.toml | 1 + day9/src/main.rs | 11 ++--------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/day9/Cargo.lock b/day9/Cargo.lock index f5578cf..676a45b 100644 --- a/day9/Cargo.lock +++ b/day9/Cargo.lock @@ -2,6 +2,13 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aoc-shared" +version = "0.1.0" + [[package]] name = "day9" version = "0.1.0" +dependencies = [ + "aoc-shared", +] diff --git a/day9/Cargo.toml b/day9/Cargo.toml index b5e5273..c152f18 100644 --- a/day9/Cargo.toml +++ b/day9/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +aoc-shared = { path = "../aoc-shared"} \ No newline at end of file diff --git a/day9/src/main.rs b/day9/src/main.rs index 789c910..3872c67 100644 --- a/day9/src/main.rs +++ b/day9/src/main.rs @@ -1,13 +1,6 @@ use std::collections::HashSet; - -#[derive(Debug)] -enum Direction { - Up, - Down, - Left, - Right, -} -use Direction::*; +use aoc_shared::enums::*; +use aoc_shared::enums::Direction::*; struct Move { dir: Direction,