1
0

Fix formatting

This commit is contained in:
Stefan Müller
2025-12-08 17:06:27 +01:00
parent 496293b33b
commit 449e7f75ac
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ mod solvers;
fn main() { fn main() {
println!("### Advent of Code 2025 ###\n"); println!("### Advent of Code 2025 ###\n");
solvers::run(solvers::printing_department::PrintingDepartment{}); solvers::run(solvers::printing_department::PrintingDepartment {});
solvers::run(solvers::cafeteria::Cafeteria{}); solvers::run(solvers::cafeteria::Cafeteria {});
solvers::run(solvers::trash_compactor::TrashCompactor {}); solvers::run(solvers::trash_compactor::TrashCompactor {});
} }
+3 -1
View File
@@ -13,7 +13,9 @@ impl Solver for Cafeteria {
fn process_data<R: BufRead>(&self, mut reader: R) -> (u64, u64) { fn process_data<R: BufRead>(&self, mut reader: R) -> (u64, u64) {
// Builds intervals collection. // Builds intervals collection.
let mut intervals: BTreeSet<Interval> = BTreeSet::new(); let mut intervals: BTreeSet<Interval> = BTreeSet::new();
for line in reader.by_ref().lines() for line in reader
.by_ref()
.lines()
.map_while(|x| x.ok().filter(|s| !s.is_empty())) .map_while(|x| x.ok().filter(|s| !s.is_empty()))
{ {
let values: Vec<u64> = line.split('-').map_while(|s| s.parse().ok()).collect(); let values: Vec<u64> = line.split('-').map_while(|s| s.parse().ok()).collect();