Piece: use char for symbol
This commit is contained in:
parent
34d1b0dcef
commit
034607da0b
@ -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 => '□',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user