Skip to content

Commit

Permalink
Replace unnecessary unwrap_ors in day 01
Browse files Browse the repository at this point in the history
  • Loading branch information
Riari committed Dec 2, 2023
1 parent 9837f60 commit a571067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bin/01.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ fn solve(input: &str, with_words: bool) -> Option<u32> {
continue;
}

let min = *digits.keys().min().unwrap_or(&usize::max_value());
let max = *digits.keys().max().unwrap_or(&0);
let min = *digits.keys().min().unwrap();
let max = *digits.keys().max().unwrap();

values.push(digits[&min] * 10 + digits[&max]);
}
Expand Down

0 comments on commit a571067

Please sign in to comment.