Piece: use char for symbol
This commit is contained in:
@@ -140,7 +140,7 @@ impl fmt::Display for Board {
|
||||
write!(
|
||||
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)?;
|
||||
|
||||
@@ -12,10 +12,10 @@ impl Piece {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn symbol(&self) -> &'static str {
|
||||
pub const fn symbol(&self) -> char {
|
||||
match self {
|
||||
Piece::White => "■",
|
||||
Piece::Black => "□",
|
||||
Piece::White => '■',
|
||||
Piece::Black => '□',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user