This commit is contained in:
Simon Gardling 2025-01-27 22:35:02 -05:00
parent 27e936c22a
commit eb224adec3
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -34,7 +34,7 @@ pub struct Board {
impl fmt::Display for Board { impl fmt::Display for Board {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for i in 0..BOARD_SIZE { for i in 0..BOARD_SIZE {
write!(f, "{}\n", "-".repeat(BOARD_SIZE * 2 + 1))?; writeln!(f, "{}", "-".repeat(BOARD_SIZE * 2 + 1))?;
write!(f, "|")?; write!(f, "|")?;
for j in 0..BOARD_SIZE { for j in 0..BOARD_SIZE {
@ -44,7 +44,7 @@ impl fmt::Display for Board {
self.get(i, j).as_ref().map(Piece::text).unwrap_or(" ") self.get(i, j).as_ref().map(Piece::text).unwrap_or(" ")
)?; )?;
} }
write!(f, "\n")?; writeln!(f)?;
} }
Ok(()) Ok(())
} }