M common/src/input.rs => common/src/input.rs +2 -2
@@ 7,7 7,7 @@ pub fn read_line() -> String {
Ok(_) => {
input.pop();
}
- Err(error) => panic!("{}", error)
+ Err(error) => panic!("{}", error),
}
input
@@ 29,7 29,7 @@ pub fn read_lines() -> Vec<String> {
lines.push(input.clone());
}
- Err(error) => panic!("{}", error)
+ Err(error) => panic!("{}", error),
}
}
M day_01/src/main.rs => day_01/src/main.rs +8 -2
@@ 7,13 7,19 @@ fn main() {
.map(|x| calculate_fuel(&x) as u32)
.collect();
- println!("[PART ONE] sum of the fuel requirements: {}", fuel.iter().sum::<u32>());
+ println!(
+ "[PART ONE] sum of the fuel requirements: {}",
+ fuel.iter().sum::<u32>()
+ );
for f in fuel.iter_mut() {
*f += calculate_fuel_recursive(f);
}
- println!("[PART TWO] sum of the fuel requirements: {}", fuel.iter().sum::<u32>());
+ println!(
+ "[PART TWO] sum of the fuel requirements: {}",
+ fuel.iter().sum::<u32>()
+ );
}
fn calculate_fuel(mass: &u32) -> i32 {