1
0
Fork 0

remove debug derives

main
Andrew Coleman 2023-12-13 13:48:00 -05:00
parent e6cf50fb47
commit fc5670b37e
6 changed files with 11 additions and 23 deletions

View File

@ -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<Turn>,

View File

@ -1,7 +1,6 @@
use aoc_runner_derive::{aoc, aoc_generator};
use std::collections::HashSet;
#[derive(Debug)]
struct Card {
id: usize,
winning: HashSet<u32>,

View File

@ -1,6 +1,5 @@
use aoc_runner_derive::{aoc, aoc_generator};
#[derive(Debug)]
struct Race {
time: u64,
distance: u64,

View File

@ -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<T>(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],

View File

@ -11,7 +11,7 @@ struct MetalIsland {
start: Step,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Clone, Copy, PartialEq, Eq)]
enum Pieces {
Empty,
Start,

View File

@ -27,7 +27,7 @@ impl Galaxy {
}
}
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[derive(Eq, PartialEq, Copy, Clone)]
struct Coord(usize, usize);
impl Coord {