day(01): use color-eyre for catching errors
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
7fb03bf9b2
commit
6b1802886d
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
use aoc_2022::file_to_lines;
|
||||
|
||||
use color_eyre::eyre::Result;
|
||||
use tracing::*;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
|
@ -35,7 +36,7 @@ fn parse_input(pathname: &str) -> Vec<i32> {
|
|||
.collect()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(EnvFilter::from_default_env())
|
||||
.with_target(false)
|
||||
|
@ -44,11 +45,14 @@ fn main() {
|
|||
.without_time()
|
||||
.compact()
|
||||
.init();
|
||||
color_eyre::install()?;
|
||||
|
||||
let input = parse_input("inputs/day01.txt");
|
||||
|
||||
info!("Part 1: {}", part_1(&input));
|
||||
info!("Part 2: {}", part_2(&input));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue