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