diff --git a/src/repr.rs b/src/repr.rs index 3cad575..ad02c66 100644 --- a/src/repr.rs +++ b/src/repr.rs @@ -34,7 +34,7 @@ pub struct Board { impl fmt::Display for Board { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { for i in 0..BOARD_SIZE { - write!(f, "{}\n", "-".repeat(BOARD_SIZE * 2 + 1))?; + writeln!(f, "{}", "-".repeat(BOARD_SIZE * 2 + 1))?; write!(f, "|")?; 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(" ") )?; } - write!(f, "\n")?; + writeln!(f)?; } Ok(()) }