[board] Implement fmt::Display for Piece
This commit is contained in:
parent
ecc1ee85d4
commit
49c5a0b51d
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue