[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, |     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 }, | ||||||
|  |  | ||||||
|  | @ -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), | ||||||
|  |  | ||||||
|  | @ -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, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue