From b796156ea51b7118c9f9dc9061b1b5cf85eb87a2 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 5 Apr 2026 02:57:23 +0100 Subject: [PATCH] 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. --- src/modes/pair.rs | 2 +- src/modes/single.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modes/pair.rs b/src/modes/pair.rs index 6eccbfa..a4a2faa 100644 --- a/src/modes/pair.rs +++ b/src/modes/pair.rs @@ -4,7 +4,7 @@ use crate::{ }; #[derive(Eq, Debug, Copy, Clone)] -pub struct Pair(pub Card, pub Card); +pub struct Pair(Card, Card); impl Pair { /** Create a new pair utilising two cards, `c1` and `c2`. Will return None diff --git a/src/modes/single.rs b/src/modes/single.rs index 0bd55f8..d63bc65 100644 --- a/src/modes/single.rs +++ b/src/modes/single.rs @@ -1,7 +1,7 @@ use crate::card::Card; #[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Copy, Clone)] -pub struct Single(pub Card); +pub struct Single(Card); impl Single { /** Create a new single from a card `c`. Will return None if a Single