From 00000220cb2ea008186b96a391c21574f16302ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sun, 25 Dec 2022 11:34:12 +0100 Subject: [PATCH] feat: add elves dep --- Cargo.lock | 12 ++++++++++++ Cargo.toml | 1 + src/utils/constants.rs | 1 - src/utils/input_parsers.rs | 27 --------------------------- src/utils/mod.rs | 2 -- 5 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 src/utils/constants.rs delete mode 100644 src/utils/input_parsers.rs delete mode 100644 src/utils/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 9dcf46a..19c4d0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,7 @@ name = "aoc" version = "21.0.0" dependencies = [ "dotenv", + "elves", "hashbrown 0.13.1", "hex-literal", "itertools", @@ -106,6 +107,17 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "elves" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8712f8a52ebcd103fa847933119084279608d42e2087079b686f405a2700d2ca" +dependencies = [ + "hashbrown 0.13.1", + "itertools", + "regex", +] + [[package]] name = "encoding_rs" version = "0.8.31" diff --git a/Cargo.toml b/Cargo.toml index 1e4334f..0cae1d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ default-run = "aoc" [dependencies] # framework dotenv = "0.15.0" +elves = "0.1.0" hashbrown = "0.13.1" hex-literal = "0.3.4" itertools = "0.10.5" diff --git a/src/utils/constants.rs b/src/utils/constants.rs deleted file mode 100644 index 1f9c793..000000000 --- a/src/utils/constants.rs +++ /dev/null @@ -1 +0,0 @@ -pub const VOWELS: &str = "aeiou"; diff --git a/src/utils/input_parsers.rs b/src/utils/input_parsers.rs deleted file mode 100644 index 2c1df5c..000000000 --- a/src/utils/input_parsers.rs +++ /dev/null @@ -1,27 +0,0 @@ -use std::{fmt::Debug, str::FromStr}; - -pub fn to_vec(input: &str, split: char) -> Vec -where - T: FromStr, - ::Err: Debug, -{ - input - .split(split) - .map(|x| x.parse::().unwrap()) - .collect() -} - -pub fn to_vec_vec(input: &str, split_rows: char, split_row: char) -> Vec> -where - T: FromStr, - ::Err: Debug, -{ - input - .split(split_rows) - .map(|x| { - x.split(split_row) - .map(|y| y.parse::().unwrap()) - .collect() - }) - .collect() -} diff --git a/src/utils/mod.rs b/src/utils/mod.rs deleted file mode 100644 index 82c1c1a..000000000 --- a/src/utils/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod constants; -pub mod input_parsers;