2019 - day1 - part 2: use fuel_calc function
This commit is contained in:
parent
b46919a2e5
commit
18d09765e2
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ fn fuel_calc(mass: i32) -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fuel_calc_with_fuel(mass: i32) -> i32 {
|
fn fuel_calc_with_fuel(mass: i32) -> i32 {
|
||||||
let fuel = mass / 3 - 2;
|
let fuel = fuel_calc(mass);
|
||||||
if fuel <= 0 {
|
if fuel <= 0 {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue