2019: switch to anyhow
This commit is contained in:
parent
d91165207f
commit
deb808faf3
19 changed files with 84 additions and 114 deletions
|
|
@ -1,8 +1,7 @@
|
|||
use std::collections::HashSet;
|
||||
use std::fmt::Write;
|
||||
|
||||
use aoc::err;
|
||||
use aoc::Result;
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
const INPUT: &str = include_str!("../input/day10.txt");
|
||||
|
||||
|
|
@ -85,7 +84,7 @@ fn part1(input: &str) -> Result<usize> {
|
|||
};
|
||||
}
|
||||
|
||||
let best = best.ok_or_else(|| err!("zero asteroid provided"))?;
|
||||
let best = best.context("zero asteroid provided")?;
|
||||
Ok(best.len())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue