[board] Create const arrays for Shape that return &'static to its enum cases
This commit is contained in:
parent
878d771d86
commit
750b16970f
3 changed files with 17 additions and 8 deletions
|
@ -129,7 +129,7 @@ impl Position {
|
|||
pub fn piece_on_square(&self, sq: Square) -> Option<PlacedPiece> {
|
||||
for color in Color::iter() {
|
||||
for shape in Shape::iter() {
|
||||
let piece = Piece::new(color, shape);
|
||||
let piece = Piece::new(color, *shape);
|
||||
let bb = self.bitboard_for_piece(piece);
|
||||
if bb.has_piece_at(&sq) {
|
||||
return Some(PlacedPiece::new(piece, sq));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue