Piece: use char for symbol

This commit is contained in:
Simon Gardling 2025-02-19 21:53:42 -05:00
parent 34d1b0dcef
commit 034607da0b
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 4 additions and 4 deletions

View File

@ -140,7 +140,7 @@ impl fmt::Display for Board {
write!( write!(
f, f,
"{}|", "{}|",
self.get(i, j).as_ref().map(Piece::symbol).unwrap_or(" ") self.get(i, j).as_ref().map(Piece::symbol).unwrap_or(' ')
)?; )?;
} }
writeln!(f)?; writeln!(f)?;

View File

@ -12,10 +12,10 @@ impl Piece {
} }
} }
pub const fn symbol(&self) -> &'static str { pub const fn symbol(&self) -> char {
match self { match self {
Piece::White => "", Piece::White => '■',
Piece::Black => "", Piece::Black => '□',
} }
} }