modes:*: doc strings

This commit is contained in:
2026-04-02 06:08:23 +01:00
committed by oreodave
parent 439b787040
commit da60b41b97
2 changed files with 8 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ pub enum Footstool {
}
pub trait Hand {
/** Given two instances of a Hand (`self` and `other`), verify if `self`
footstools `other`. */
fn footstool(&self, other: &Self) -> Footstool;
}

View File

@@ -4,6 +4,12 @@ use crate::card::Card;
pub struct Single(Card);
impl Single {
/** Create a new single from a card `c`. Will return None if a Single
cannot be constructed from that card.
The only situation where a card cannot be converted into a Single is if it's
a Joker.
*/
fn new(c: Card) -> Option<Single> {
(!c.is_joker()).then_some(Single(c))
}