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()