day18: clippies
All checks were successful
test / AoC 2024 (push) Successful in 3m21s

This commit is contained in:
Keenan Tims 2024-12-18 15:41:57 -08:00
parent 0fee7c3594
commit dbee7d91b6
Signed by: ktims
GPG Key ID: 11230674D69038D4

View File

@ -1,7 +1,10 @@
use aoc_runner_derive::aoc; use aoc_runner_derive::aoc;
use grid::Grid; use grid::Grid;
use itertools::Itertools; use itertools::Itertools;
use std::{cmp::Reverse, collections::{BinaryHeap, VecDeque}}; use std::{
cmp::Reverse,
collections::{BinaryHeap, VecDeque},
};
#[derive(Clone)] #[derive(Clone)]
struct MemoryMap { struct MemoryMap {
@ -127,6 +130,7 @@ impl MemoryMap {
None None
} }
#[allow(dead_code)] // will be moved to Grid at some point
fn dijkstra<T: PathTrack>(&self, start: (i64, i64)) -> Option<T> { fn dijkstra<T: PathTrack>(&self, start: (i64, i64)) -> Option<T> {
let goal = (self.map.width() as i64 - 1, self.map.height() as i64 - 1); let goal = (self.map.width() as i64 - 1, self.map.height() as i64 - 1);
@ -222,7 +226,7 @@ pub fn part2_impl(input: &str, width: usize, height: usize, initial_safe_byte_co
local_map.bfs::<NoopTrack>((0, 0)).is_some() local_map.bfs::<NoopTrack>((0, 0)).is_some()
}) + initial_safe_byte_count; }) + initial_safe_byte_count;
return input_map.byte_stream[solution]; input_map.byte_stream[solution]
} }
#[aoc(day18, part1)] #[aoc(day18, part1)]