feat: add template

This commit is contained in:
uku 2024-12-01 14:07:50 +01:00
parent 0279c63a39
commit 4c0b4fb32d
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
3 changed files with 51 additions and 0 deletions

7
Cargo.lock generated
View file

@ -13,6 +13,7 @@ name = "advent-of-code-2024"
version = "0.1.0"
dependencies = [
"dotenvy",
"indoc",
"ureq",
]
@ -232,6 +233,12 @@ dependencies = [
"icu_properties",
]
[[package]]
name = "indoc"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]]
name = "libc"
version = "0.2.167"

View file

@ -5,4 +5,5 @@ edition = "2021"
[dependencies]
dotenvy = "0.15.7"
indoc = "2.0.5"
ureq = "2.11.0"

43
src/solutions/template.rs Normal file
View file

@ -0,0 +1,43 @@
use crate::common::{Answer, Solution};
pub struct DayXX;
impl Solution for DayXX {
fn name(&self) -> &'static str {
""
}
fn part_a(&self, input: &str) -> Answer {
Answer::Unimplemented
}
fn part_b(&self, input: &str) -> Answer {
Answer::Unimplemented
}
}
#[cfg(test)]
mod test {
use super::DayXX;
use crate::common::Solution;
use indoc::indoc;
const INPUT_A: &str = indoc! {"
"};
const INPUT_B: &str = indoc! {"
"};
#[test]
fn part_a() {
assert_eq!(DayXX.part_a(INPUT_A), crate::common::Answer::Unimplemented);
}
#[test]
fn part_b() {
assert_eq!(DayXX.part_b(INPUT_B), crate::common::Answer::Unimplemented);
}
}