feat: add elves dep

This commit is contained in:
Matej Janezic 2022-12-25 11:34:12 +01:00
parent 00000210a6
commit 0000022075
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
5 changed files with 13 additions and 30 deletions

12
Cargo.lock generated
View File

@ -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"

View File

@ -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"

View File

@ -1 +0,0 @@
pub const VOWELS: &str = "aeiou";

View File

@ -1,27 +0,0 @@
use std::{fmt::Debug, str::FromStr};
pub fn to_vec<T>(input: &str, split: char) -> Vec<T>
where
T: FromStr,
<T as FromStr>::Err: Debug,
{
input
.split(split)
.map(|x| x.parse::<T>().unwrap())
.collect()
}
pub fn to_vec_vec<T>(input: &str, split_rows: char, split_row: char) -> Vec<Vec<T>>
where
T: FromStr,
<T as FromStr>::Err: Debug,
{
input
.split(split_rows)
.map(|x| {
x.split(split_row)
.map(|y| y.parse::<T>().unwrap())
.collect()
})
.collect()
}

View File

@ -1,2 +0,0 @@
pub mod constants;
pub mod input_parsers;