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