modes:single|pair: make default struct construction private

If all fields are public, users are allowed to use the default struct
constructor.  Obviously we want users to only use the static ::new
method.
This commit is contained in:
2026-04-05 02:57:23 +01:00
committed by oreodave
parent fa4d8efb78
commit b796156ea5
2 changed files with 2 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ use crate::{
}; };
#[derive(Eq, Debug, Copy, Clone)] #[derive(Eq, Debug, Copy, Clone)]
pub struct Pair(pub Card, pub Card); pub struct Pair(Card, Card);
impl Pair { impl Pair {
/** Create a new pair utilising two cards, `c1` and `c2`. Will return None /** Create a new pair utilising two cards, `c1` and `c2`. Will return None

View File

@@ -1,7 +1,7 @@
use crate::card::Card; use crate::card::Card;
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Copy, Clone)] #[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Copy, Clone)]
pub struct Single(pub Card); pub struct Single(Card);
impl Single { impl Single {
/** Create a new single from a card `c`. Will return None if a Single /** Create a new single from a card `c`. Will return None if a Single