pub fn total_fuel(module_mass: i32) -> i32 {
    let mut mass_fuel: i32 = self::fuel(module_mass);
    // If the fuel is > 0, add the fuel for the remainder recursively
    if mass_fuel > 0 {
        mass_fuel += self::total_fuel(mass_fuel);
        return mass_fuel;
    }
    // Else, return 0 explicitly, so we don't end up returning a negative value and getting the
    // wrong result
    0
}
/// Calculates the fuel needed for the given module, including fuel needed for it's own fuel
Calculates the fuel needed for the given module, including fuel needed for it's own fuel
Calculates the fuel needed for the given module including fuel needed for it ' s own fuel
pub fn total_fuel(module_mass: i32) -> i32 {
    let mut mass_fuel: i32 = self::fuel(module_mass);
    // If the fuel is > 0, add the fuel for the remainder recursively
    if mass_fuel > 0 {
        mass_fuel += self::total_fuel(mass_fuel);
        return mass_fuel;
    }
    // Else, return 0 explicitly, so we don't end up returning a negative value and getting the
    // wrong result
    0
}
pub fn total_fuel ( module_mass : i32 ) -> i32 { let mut mass_fuel : i32 = self :: fuel ( module_mass ) ; // If the fuel is > 0, add the fuel for the remainder recursively if mass_fuel > 0 { mass_fuel += self :: total_fuel ( mass_fuel ) ; return mass_fuel ; } // Else, return 0 explicitly, so we don't end up returning a negative value and getting the // wrong result 0 }
Calculates the fuel needed for the given module, including fuel needed for it's own fuel
Calculates the fuel needed for the given module including fuel needed for it ' s own fuel
module_mass
i32
module_mass
i32