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:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user