[board] Clean up variables names in piece_sets.rs so creating an error is a little more succinct
This commit is contained in:
parent
c7be0e3e2b
commit
67448b44d7
1 changed files with 2 additions and 5 deletions
|
@ -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,
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue