modes:mod: Hand::high_card
A way to return the high card of any one hand for quick comparison.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user