This commit is contained in:
Crispy 2024-12-16 22:43:12 +01:00
parent ba1f404250
commit 4427b4c2fc
5 changed files with 36 additions and 38 deletions

View file

@ -45,7 +45,7 @@ impl Board {
let mut out = String::new();
for row in &self.rows {
for tile in row {
out.push(tile.to_char())
out.push(tile.to_char());
}
out.push('\n');
}
@ -153,7 +153,7 @@ impl Board {
// top
{
let mut n = 0;
while n < self.height && self.rows[n].iter().all(Tile::is_blank) {
while n < self.height && self.rows[n].iter().all(|t| t.is_blank()) {
n += 1;
}
let trim_top = n.saturating_sub(margin);
@ -166,7 +166,7 @@ impl Board {
// bottom
{
let mut n = 0;
while n < self.height && self.rows[self.height - n - 1].iter().all(Tile::is_blank) {
while n < self.height && self.rows[self.height - n - 1].iter().all(|t| t.is_blank()) {
n += 1;
}
let trim_bottom = n.saturating_sub(margin);