Add 'NUM_VARIANTS' constant to all 'board' enums
This commit is contained in:
parent
2c140d0481
commit
337b8f61f4
5 changed files with 20 additions and 5 deletions
|
|
@ -15,7 +15,10 @@ pub enum Rank {
|
|||
}
|
||||
|
||||
impl Rank {
|
||||
const ALL: [Self; 8] = [
|
||||
/// The number of [Rank] variants.
|
||||
pub const NUM_VARIANTS: usize = 8;
|
||||
|
||||
const ALL: [Self; Self::NUM_VARIANTS] = [
|
||||
Self::First,
|
||||
Self::Second,
|
||||
Self::Third,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue