From fc5670b37ecf960ad7b7efe27d0e26181b480491 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Wed, 13 Dec 2023 13:48:00 -0500 Subject: [PATCH] remove debug derives --- 2023/src/day02.rs | 2 -- 2023/src/day04.rs | 1 - 2023/src/day06.rs | 1 - 2023/src/day07.rs | 26 +++++++++----------------- 2023/src/day10.rs | 2 +- 2023/src/day11.rs | 2 +- 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/2023/src/day02.rs b/2023/src/day02.rs index d87ed3d..af15bdf 100644 --- a/2023/src/day02.rs +++ b/2023/src/day02.rs @@ -4,14 +4,12 @@ const MAX_RED: u32 = 12; const MAX_GREEN: u32 = 13; const MAX_BLUE: u32 = 14; -#[derive(Debug)] struct Turn { red: u32, green: u32, blue: u32, } -#[derive(Debug)] struct Game { id: u32, turns: Vec, diff --git a/2023/src/day04.rs b/2023/src/day04.rs index d274580..22dda55 100644 --- a/2023/src/day04.rs +++ b/2023/src/day04.rs @@ -1,7 +1,6 @@ use aoc_runner_derive::{aoc, aoc_generator}; use std::collections::HashSet; -#[derive(Debug)] struct Card { id: usize, winning: HashSet, diff --git a/2023/src/day06.rs b/2023/src/day06.rs index 11a9e2a..cbd40dc 100644 --- a/2023/src/day06.rs +++ b/2023/src/day06.rs @@ -1,6 +1,5 @@ use aoc_runner_derive::{aoc, aoc_generator}; -#[derive(Debug)] struct Race { time: u64, distance: u64, diff --git a/2023/src/day07.rs b/2023/src/day07.rs index e0689a0..8d83cf8 100644 --- a/2023/src/day07.rs +++ b/2023/src/day07.rs @@ -3,7 +3,7 @@ use std::cmp::Ordering; use std::collections::{BTreeMap, HashSet}; use std::str::FromStr; -#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Debug)] +#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] enum Card { A, K, @@ -20,7 +20,7 @@ enum Card { C2, } -#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] enum Part2Card { A, K, @@ -77,7 +77,7 @@ impl FromStr for Card { } } -#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd)] +#[derive(Clone, Eq, Ord, PartialEq, PartialOrd)] enum HandKinds { FiveAlike, FourAlike, @@ -88,7 +88,7 @@ enum HandKinds { HighCard, } -#[derive(Debug, Clone)] +#[derive(Clone)] struct Hand { bid: u64, cards: [Card; 5], @@ -123,10 +123,7 @@ impl Ord for Hand { } else if self.cards[4] != other.cards[4] { self.cards[4].cmp(&other.cards[4]) } else { - panic!( - "could not sort hand {:?} with {:?}", - self.cards, other.cards - ) + panic!("could not sort hand") } } else { self.hand_kind.cmp(&other.hand_kind) @@ -162,10 +159,7 @@ impl Ord for Part2Hand { } else if self.cards[4] != other.cards[4] { self.cards[4].cmp(&other.cards[4]) } else { - panic!( - "could not sort hand {:?} with {:?}", - self.cards, other.cards - ) + panic!("could not sort hand") } } else { self.hand_kind.cmp(&other.hand_kind) @@ -175,7 +169,7 @@ impl Ord for Part2Hand { fn get_hand_type(cards: &[T; 5]) -> HandKinds where - T: std::fmt::Debug + Eq + PartialEq + PartialOrd + std::hash::Hash, + T: Eq + PartialEq + PartialOrd + std::hash::Hash, { let mut distinct_cards: HashSet<&T> = HashSet::new(); for c in cards.iter() { @@ -212,14 +206,12 @@ where 4 => HandKinds::OnePair, 5 => HandKinds::HighCard, _ => panic!( - "expected to find size 1-5, but instead got {} from line {:?}", - distinct_cards.len(), - cards + "expected to find size 1-5, but instead got {}", + distinct_cards.len() ), } } -#[derive(Debug)] struct Part2Hand { bid: u64, cards: [Part2Card; 5], diff --git a/2023/src/day10.rs b/2023/src/day10.rs index 17ad403..b046538 100644 --- a/2023/src/day10.rs +++ b/2023/src/day10.rs @@ -11,7 +11,7 @@ struct MetalIsland { start: Step, } -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, PartialEq, Eq)] enum Pieces { Empty, Start, diff --git a/2023/src/day11.rs b/2023/src/day11.rs index 2e1183f..bf23d9b 100644 --- a/2023/src/day11.rs +++ b/2023/src/day11.rs @@ -27,7 +27,7 @@ impl Galaxy { } } -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Eq, PartialEq, Copy, Clone)] struct Coord(usize, usize); impl Coord {