Fix formatting
This commit is contained in:
+2
-2
@@ -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 {});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user