Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2189c42

Browse files
committedSep 1, 2024··
chore: RIP super enums
1 parent 226ccfa commit 2189c42

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed
 

‎games/src/ataxx/square.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ use crate::interface::{representable_type, RepresentableType, SquareType};
1919
representable_type!(
2020
/// Square represents all the squares present on an Ataxx Board.
2121
/// The index of each Square is equal to `rank-index * 8 + file-index`.
22-
super enum Square: u8 {
23-
A1 B1 C1 D1 E1 F1 G1
24-
A2 B2 C2 D2 E2 F2 G2
25-
A3 B3 C3 D3 E3 F3 G3
26-
A4 B4 C4 D4 E4 F4 G4
27-
A5 B5 C5 D5 E5 F5 G5
28-
A6 B6 C6 D6 E6 F6 G6
29-
A7 B7 C7 D7 E7 F7 G7
22+
enum Square: u8 {
23+
A1 "a1", B1 "b1", C1 "c1", D1 "d1", E1 "e1", F1 "f1", G1 "g1",
24+
A2 "a2", B2 "b2", C2 "c2", D2 "d2", E2 "e2", F2 "f2", G2 "g2",
25+
A3 "a3", B3 "b3", C3 "c3", D3 "d3", E3 "e3", F3 "f3", G3 "g3",
26+
A4 "a4", B4 "b4", C4 "c4", D4 "d4", E4 "e4", F4 "f4", G4 "g4",
27+
A5 "a5", B5 "b5", C5 "c5", D5 "d5", E5 "e5", F5 "f5", G5 "g5",
28+
A6 "a6", B6 "b6", C6 "c6", D6 "d6", E6 "e6", F6 "f6", G6 "g6",
29+
A7 "a7", B7 "b7", C7 "c7", D7 "d7", E7 "e7", F7 "f7", G7 "g7",
3030
}
3131
);
3232

@@ -38,7 +38,7 @@ impl SquareType for Square {
3838
representable_type!(
3939
/// File represents a file on the Ataxx Board. Each vertical column of Squares
4040
/// on an Ataxx Board is known as a File. There are 7 of them in total.
41-
super enum File: u8 { A B C D E F G }
41+
enum File: u8 { A "a", B "b", C "c", D "d", E "e", F "f", G "g", }
4242
);
4343

4444
representable_type!(

‎games/src/interface/mod.rs

-9
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ pub enum TypeParseError {
4343

4444
#[macro_export]
4545
macro_rules! representable_type {
46-
($(#[doc = $doc:expr])* super enum $type:tt: $base:tt { $($variant:tt)* }) => {
47-
representable_type!(
48-
$(#[doc = $doc])*
49-
enum $type: $base {
50-
$($variant stringify!($variant),)*
51-
}
52-
);
53-
};
54-
5546
($(#[doc = $doc:expr])* enum $type:tt: $base:tt { $($variant:tt $repr:expr,)* }) => {
5647
$(#[doc = $doc])*
5748
#[derive(Copy, Clone, PartialEq, Eq, Debug, strum_macros::EnumIter)]

0 commit comments

Comments
 (0)
Please sign in to comment.