satisfying clippy's pedantic warnings

This commit is contained in:
Dylan Thies
2024-12-01 10:08:39 -05:00
parent 0041f900a0
commit 7a85bc1d09
2 changed files with 10 additions and 2 deletions

View File

@@ -11,6 +11,11 @@ pub enum Day1Part1Error {
ParseError, ParseError,
} }
/// Day-1 Part 1 for 2024 advent of code
/// Problem can be found here: <https://adventofcode.com/2024/day/1>
///
/// # Errors
/// - `ParseError` there was an issue with the parser
pub fn part1(input: &str) -> Result<u64, Day1Part1Error> { pub fn part1(input: &str) -> Result<u64, Day1Part1Error> {
let (_, (mut col1, mut col2)) = parse_input(input) let (_, (mut col1, mut col2)) = parse_input(input)
.map_err(|x| Report::from(x.to_owned())) .map_err(|x| Report::from(x.to_owned()))

View File

@@ -11,10 +11,13 @@ use thiserror::Error;
pub enum Day1Part2Error { pub enum Day1Part2Error {
#[error("Problem parsing Day 1")] #[error("Problem parsing Day 1")]
ParseError, ParseError,
#[error("Catastophic error")]
FatalError,
} }
/// Day-1 Part 2 for 2024 advent of code
/// Problem can be found here: <https://adventofcode.com/2024/day/1#part2>
///
/// # Errors
/// - `ParseError` there was an issue with the parser
pub fn part2(input: &str) -> Result<u64, Day1Part2Error> { pub fn part2(input: &str) -> Result<u64, Day1Part2Error> {
let (_, (col1, col2)) = parse_input(input) let (_, (col1, col2)) = parse_input(input)
.map_err(|x| Report::from(x.to_owned())) .map_err(|x| Report::from(x.to_owned()))