modes:mod: Hand::high_card

A way to return the high card of any one hand for quick comparison.
This commit is contained in:
2026-04-14 21:23:07 +01:00
committed by oreodave
parent e72f8b2c3a
commit 25511443a5

View File

@@ -1,3 +1,5 @@
use crate::card::Card;
pub mod pair; pub mod pair;
pub mod single; pub mod single;
pub mod triple; pub mod triple;
@@ -17,6 +19,8 @@ pub trait Hand: Ord {
!self.is_proper() !self.is_proper()
} }
fn high_card(&self) -> Card;
/// Given two instances of a Hand (`self` and `other`), verify if `self` /// Given two instances of a Hand (`self` and `other`), verify if `self`
/// footstools `other`. /// footstools `other`.
fn footstool(&self, other: &Self) -> Footstool; fn footstool(&self, other: &Self) -> Footstool;
@@ -47,8 +51,7 @@ mod tests {
(Footstool::Full, Footstool::Full) => x == y, (Footstool::Full, Footstool::Full) => x == y,
_ => false, _ => false,
}, },
"Expected footstool on {}, {} ({:?}, {:?}) to match a recognised "Expected footstool on {}, {} ({:?}, {:?}) to match a recognised pattern",
pattern",
x, x,
y, y,
res1, res1,