Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Dec 7, 2023
1 parent 1407d45 commit 040d9dc
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/aoc2023/day7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Hand {
cards: [u8; 5],
}

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub struct ComputedHand {
sig: [u8; 5],
zvalues: [u8; 5],
Expand Down Expand Up @@ -90,21 +90,6 @@ impl Hand {
}
}

impl Ord for ComputedHand {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
match self.sig.cmp(&other.sig) {
std::cmp::Ordering::Equal => self.zvalues.cmp(&other.zvalues),
other => other,
}
}
}

impl PartialOrd for ComputedHand {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

#[derive(Debug, Clone)]
pub struct Entry<H> {
hand: H,
Expand Down

0 comments on commit 040d9dc

Please sign in to comment.