diff --git a/src/day8.rs b/src/day8.rs index f4ed5a6..0f8c360 100644 --- a/src/day8.rs +++ b/src/day8.rs @@ -138,28 +138,12 @@ fn part2(input: &Circuits) -> u64 { panic!() } +#[derive(PartialEq, Eq, PartialOrd, Ord)] struct JunctionPair { + d: u64, a: usize, b: usize, - d: u64, } -impl Eq for JunctionPair {} -impl PartialEq for JunctionPair { - fn eq(&self, other: &Self) -> bool { - self.d == other.d - } -} -impl PartialOrd for JunctionPair { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.d.cmp(&other.d)) - } -} -impl Ord for JunctionPair { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.d.cmp(&other.d) - } -} - fn make_heap(circuits: &Circuits) -> BinaryHeap> { BinaryHeap::from_iter( circuits