[board] Clean up variables names in piece_sets.rs so creating an error is a little more succinct

This commit is contained in:
Eryn Wells 2025-05-19 08:36:44 -07:00
parent c7be0e3e2b
commit 67448b44d7

View file

@ -92,11 +92,8 @@ impl PieceSet {
strategy: PlacePieceStrategy, strategy: PlacePieceStrategy,
) -> Result<(), PlacePieceError> { ) -> Result<(), PlacePieceError> {
if strategy == PlacePieceStrategy::PreserveExisting { if strategy == PlacePieceStrategy::PreserveExisting {
if let Some(existing_piece) = self.mailbox.get(square) { if let Some(piece) = self.mailbox.get(square) {
return Err(PlacePieceError::ExisitingPiece(PlacedPiece::new( return Err(PlacePieceError::ExisitingPiece { piece, square });
existing_piece,
square,
)));
} }
} }