From da60b41b97f71cb58679292eb50bd4907071265b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 2 Apr 2026 06:08:23 +0100 Subject: [PATCH] modes:*: doc strings --- src/modes/mod.rs | 2 ++ src/modes/single.rs | 6 ++++++ 2 files changed, 8 insertions(+) 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)) }