diff --git a/src/modes/mod.rs b/src/modes/mod.rs index 40a2e69..f08a255 100644 --- a/src/modes/mod.rs +++ b/src/modes/mod.rs @@ -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; } diff --git a/src/modes/single.rs b/src/modes/single.rs index 5c6ae8d..c60bfe8 100644 --- a/src/modes/single.rs +++ b/src/modes/single.rs @@ -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 { (!c.is_joker()).then_some(Single(c)) }