From 54ac88aaf7fd0d8ccc7177244b319e024c43d76d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 19 May 2025 16:50:44 -0700 Subject: [PATCH] [board] Remove some old PlacedPiece code --- board/src/piece_sets/mailbox.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/board/src/piece_sets/mailbox.rs b/board/src/piece_sets/mailbox.rs index 0ab8e21..9e562dd 100644 --- a/board/src/piece_sets/mailbox.rs +++ b/board/src/piece_sets/mailbox.rs @@ -1,6 +1,6 @@ // Eryn Wells -use chessfriend_core::{Piece, PlacedPiece, Square}; +use chessfriend_core::{Piece, Square}; use std::iter::FromIterator; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -22,16 +22,6 @@ impl Mailbox { pub fn remove(&mut self, square: Square) { self.0[square as usize] = None; } - - pub fn iter(&self) -> impl Iterator { - self.0 - .into_iter() - .flatten() // Remove the Nones - .zip(0u8..) // Enumerate with u8 instead of usize - .map(|(piece, index)| { - PlacedPiece::new(piece, unsafe { Square::from_index_unchecked(index) }) - }) - } } impl Default for Mailbox { @@ -46,16 +36,6 @@ impl From<[Option; Square::NUM]> for Mailbox { } } -impl FromIterator for Mailbox { - fn from_iter>(iter: T) -> Self { - iter.into_iter() - .fold(Self::new(), |mut mailbox, placed_piece| { - mailbox.set(placed_piece.piece(), placed_piece.square); - mailbox - }) - } -} - impl FromIterator<(Square, Piece)> for Mailbox { fn from_iter>(iter: T) -> Self { iter.into_iter()