mirror of
https://github.com/kristoferssolo/Advent-of-Code.git
synced 2026-02-04 06:12:01 +00:00
refactor(day-01): use new template
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
use color_eyre::Result;
|
||||
use day_01::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)?;
|
||||
let result = process(file).context("process part 1")?;
|
||||
println!("{}", result);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
use color_eyre::Result;
|
||||
use day_01::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)?;
|
||||
let result = process(file).context("process part 2")?;
|
||||
println!("{}", result);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use color_eyre::Result;
|
||||
use miette::Result;
|
||||
|
||||
#[tracing::instrument]
|
||||
pub fn process(input: &str) -> Result<usize> {
|
||||
let (mut firsts, mut lasts): (Vec<_>, Vec<_>) = input
|
||||
.lines()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use color_eyre::Result;
|
||||
use miette::Result;
|
||||
|
||||
#[tracing::instrument]
|
||||
pub fn process(input: &str) -> Result<usize> {
|
||||
let sum = {
|
||||
let (firsts, lasts): (Vec<_>, Vec<_>) = input
|
||||
|
||||
Reference in New Issue
Block a user