Skip to content

Commit

Permalink
chore: more macro hygiene
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Dec 26, 2024
1 parent 4f856ca commit 2da853f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 1 addition & 3 deletions games/src/ataxx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ mod position;
#[cfg(test)]
mod tests;

use crate::interface::game_details;

game_details!(
crate::interface::game_details!(
@bitboard_less
Files: A, B, C, D, E, F, G;
Ranks: 1 First, 2 Second, 3 Third, 4 Fourth, 5 Fifth, 6 Sixth, 7 Seventh;
Expand Down
4 changes: 2 additions & 2 deletions games/src/chess/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ mod tests;

use std::ops;

use crate::interface::{game_details, RepresentableType, SquareType};
use crate::interface::{RepresentableType, SquareType};

game_details!(
crate::interface::game_details!(
@bitboard_less
Files: A, B, C, D, E, F, G, H;
Ranks: 1 First, 2 Second, 3 Third, 4 Fourth, 5 Fifth, 6 Sixth, 7 Seventh, 8 Eighth;
Expand Down
8 changes: 4 additions & 4 deletions games/src/interface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ macro_rules! game_details {
$color_2:ident $color_2_repr:literal ($($piece_2_repr:literal),*);
) => {
// Square types.
game_details!(
$crate::interface::game_details!(
@squares
Files: $($file_variant),* ;
Ranks: $($rank_number $rank_variant),* ;
);

// Piece types.
game_details!(
$crate::interface::game_details!(
@pieces
Pieces: $($piece_variant $piece_repr),*;
$($other_variant $other_repr),*;
Expand All @@ -133,7 +133,7 @@ macro_rules! game_details {
Colors: $color_1:ident $color_1_repr:literal ($($piece_1_repr:literal),*),
$color_2:ident $color_2_repr:literal ($($piece_2_repr:literal),*);
) => {
game_details!(
$crate::interface::game_details!(
@color $color_1 $color_1_repr; $color_2 $color_2_repr;
);

Expand Down Expand Up @@ -235,7 +235,7 @@ macro_rules! game_details {
) => {
// The Square type's variants are the cartesian product of the variants
// of its File and Rank types.
game_details!(
$crate::interface::game_details!(
@file_rank_product $($rank_number),*;$($file_variant),*
);

Expand Down
4 changes: 1 addition & 3 deletions games/src/isolation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ mod position;
#[cfg(test)]
mod tests;

use crate::interface::game_details;

game_details!(
crate::interface::game_details!(
@bitboard_less
Files: A, B, C, D, E, F, G, H;
Ranks: 1 First, 2 Second, 3 Third, 4 Fourth, 5 Fifth, 6 Sixth;
Expand Down

0 comments on commit 2da853f

Please sign in to comment.