diff --git a/board/src/piece.rs b/board/src/piece.rs index a96b1b5..8a85b11 100644 --- a/board/src/piece.rs +++ b/board/src/piece.rs @@ -130,6 +130,12 @@ impl Piece { piece_constructor!(king, King); } +impl fmt::Display for Piece { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.shape) + } +} + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct PlacedPiece { pub piece: Piece,