From 18d09765e2fed1c060f8db38148d9c78522dcc31 Mon Sep 17 00:00:00 2001 From: genofire Date: Mon, 7 Sep 2020 21:31:12 +0200 Subject: [PATCH] 2019 - day1 - part 2: use fuel_calc function --- 2019/day1/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2019/day1/src/main.rs b/2019/day1/src/main.rs index a17f5d4..42153da 100644 --- a/2019/day1/src/main.rs +++ b/2019/day1/src/main.rs @@ -27,7 +27,7 @@ fn fuel_calc(mass: i32) -> i32 { } fn fuel_calc_with_fuel(mass: i32) -> i32 { - let fuel = mass / 3 - 2; + let fuel = fuel_calc(mass); if fuel <= 0 { return 0; }