From 4b96db230d269c5fddc6d115435f4abcd8bcffb1 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 21 Jun 2025 21:08:04 -0700 Subject: [PATCH] [board, moves] Derive Clone on several error types - PlacePieceError - MakeMoveError - UnmakeMoveError --- board/src/piece_sets.rs | 2 +- moves/src/make_move.rs | 2 +- moves/src/unmake_move.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/src/piece_sets.rs b/board/src/piece_sets.rs index 316c1d8..de43caa 100644 --- a/board/src/piece_sets.rs +++ b/board/src/piece_sets.rs @@ -21,7 +21,7 @@ pub enum PlacePieceStrategy { PreserveExisting, } -#[derive(Debug, Error, Eq, PartialEq)] +#[derive(Clone, Debug, Error, Eq, PartialEq)] pub enum PlacePieceError { #[error("cannot place piece on {square} with existing {piece}")] ExisitingPiece { piece: Piece, square: Square }, diff --git a/moves/src/make_move.rs b/moves/src/make_move.rs index f413e72..bcbca0a 100644 --- a/moves/src/make_move.rs +++ b/moves/src/make_move.rs @@ -18,7 +18,7 @@ pub enum ValidateMove { Yes, } -#[derive(Debug, Error, Eq, PartialEq)] +#[derive(Clone, Debug, Error, Eq, PartialEq)] pub enum MakeMoveError { #[error("no piece on {0}")] NoPiece(Square), diff --git a/moves/src/unmake_move.rs b/moves/src/unmake_move.rs index 69c43b7..6833608 100644 --- a/moves/src/unmake_move.rs +++ b/moves/src/unmake_move.rs @@ -7,7 +7,7 @@ use thiserror::Error; pub type UnmakeMoveResult = Result<(), UnmakeMoveError>; -#[derive(Debug, Error, Eq, PartialEq)] +#[derive(Clone, Debug, Error, Eq, PartialEq)] pub enum UnmakeMoveError { #[error("no move to unmake")] NoMove,