From 49c5a0b51d4f1ef964ec4a3fe2e863dd8f463702 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 26 Dec 2023 21:33:00 -0700 Subject: [PATCH] [board] Implement fmt::Display for Piece --- board/src/piece.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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,