[board, moves] Derive Clone on several error types
- PlacePieceError - MakeMoveError - UnmakeMoveError
This commit is contained in:
parent
f84319272c
commit
4b96db230d
3 changed files with 3 additions and 3 deletions
|
@ -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 },
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue