mirror of
https://github.com/kristoferssolo/Advent-of-Code.git
synced 2026-03-22 00:26:24 +00:00
Init day-02
This commit is contained in:
12
2025/day-02/src/bin/part1.rs
Normal file
12
2025/day-02/src/bin/part1.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use day_02::part1::process;
|
||||
use miette::{Context, Result};
|
||||
|
||||
#[tracing::instrument]
|
||||
fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let file = include_str!("../../input1.txt");
|
||||
let result = process(file).context("process part 1")?;
|
||||
println!("{result}");
|
||||
Ok(())
|
||||
}
|
||||
12
2025/day-02/src/bin/part2.rs
Normal file
12
2025/day-02/src/bin/part2.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use day_02::part2::process;
|
||||
use miette::{Context, Result};
|
||||
|
||||
#[tracing::instrument]
|
||||
fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let file = include_str!("../../input2.txt");
|
||||
let result = process(file).context("process part 2")?;
|
||||
println!("{result}");
|
||||
Ok(())
|
||||
}
|
||||
2
2025/day-02/src/lib.rs
Normal file
2
2025/day-02/src/lib.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod part1;
|
||||
pub mod part2;
|
||||
23
2025/day-02/src/part1.rs
Normal file
23
2025/day-02/src/part1.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use miette::Result;
|
||||
|
||||
#[tracing::instrument]
|
||||
#[allow(clippy::missing_panics_doc)]
|
||||
#[allow(clippy::missing_errors_doc)]
|
||||
pub fn process(input: &str) -> Result<usize> {
|
||||
todo!("day xx - part 1");
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_process() -> Result<()> {
|
||||
let input = "";
|
||||
todo!("haven't built test yet");
|
||||
let result = 0;
|
||||
assert_eq!(process(input)?, result);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
23
2025/day-02/src/part2.rs
Normal file
23
2025/day-02/src/part2.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use miette::Result;
|
||||
|
||||
#[tracing::instrument]
|
||||
#[allow(clippy::missing_panics_doc)]
|
||||
#[allow(clippy::missing_errors_doc)]
|
||||
pub fn process(input: &str) -> Result<usize> {
|
||||
todo!("day xx - part 2");
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_process() -> Result<()> {
|
||||
let input = "";
|
||||
todo!("haven't built test yet");
|
||||
let result = 0;
|
||||
assert_eq!(process(input)?, result);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user