diff --git a/aoc2019/src/day01.rs b/aoc2019/src/day01.rs index a79dbf1..f196c11 100644 --- a/aoc2019/src/day01.rs +++ b/aoc2019/src/day01.rs @@ -10,10 +10,7 @@ pub fn run() -> Result<()> { } fn fuel_needed(module_weight: u64) -> u64 { - match (module_weight / 3).checked_sub(2) { - Some(f) => f, - None => 0, - } + (module_weight / 3).saturating_sub(2) } fn part1(input: &str) -> Result {