[board, moves] Derive Clone on several error types

- PlacePieceError
- MakeMoveError
- UnmakeMoveError
This commit is contained in:
Eryn Wells 2025-06-21 21:08:04 -07:00
parent f84319272c
commit 4b96db230d
3 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ pub enum PlacePieceStrategy {
PreserveExisting, PreserveExisting,
} }
#[derive(Debug, Error, Eq, PartialEq)] #[derive(Clone, Debug, Error, Eq, PartialEq)]
pub enum PlacePieceError { pub enum PlacePieceError {
#[error("cannot place piece on {square} with existing {piece}")] #[error("cannot place piece on {square} with existing {piece}")]
ExisitingPiece { piece: Piece, square: Square }, ExisitingPiece { piece: Piece, square: Square },

View file

@ -18,7 +18,7 @@ pub enum ValidateMove {
Yes, Yes,
} }
#[derive(Debug, Error, Eq, PartialEq)] #[derive(Clone, Debug, Error, Eq, PartialEq)]
pub enum MakeMoveError { pub enum MakeMoveError {
#[error("no piece on {0}")] #[error("no piece on {0}")]
NoPiece(Square), NoPiece(Square),

View file

@ -7,7 +7,7 @@ use thiserror::Error;
pub type UnmakeMoveResult = Result<(), UnmakeMoveError>; pub type UnmakeMoveResult = Result<(), UnmakeMoveError>;
#[derive(Debug, Error, Eq, PartialEq)] #[derive(Clone, Debug, Error, Eq, PartialEq)]
pub enum UnmakeMoveError { pub enum UnmakeMoveError {
#[error("no move to unmake")] #[error("no move to unmake")]
NoMove, NoMove,