diff options
Diffstat (limited to 'src/minesweeper.rs')
-rw-r--r-- | src/minesweeper.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/minesweeper.rs b/src/minesweeper.rs index 288847e..9e362dc 100644 --- a/src/minesweeper.rs +++ b/src/minesweeper.rs @@ -122,7 +122,7 @@ impl Board { width: w, height: h, hidden_tiles: area, - mine_count: mine_count.clone(), + mine_count, }; b.spread_mines(mine_count) } @@ -195,7 +195,6 @@ impl Board { *c &= !(HIDDEN_BIT | FLAGGED_BIT); self.hidden_tiles -= 1; if *c > 0 { continue; } - drop(c); if let Some(mut adj) = self.neighs(pos) { queue.append(&mut adj); } @@ -207,9 +206,9 @@ impl Board { if let Some(off) = self.pos_to_off(pos) { self.flood_reveal(pos); let c = self.data[off]; - MoveResult { 0: self, 1: (c & !(FLAGGED_BIT | CORRECT_BIT)) == TILE_NUMBITS } + MoveResult(self, (c & !(FLAGGED_BIT | CORRECT_BIT)) == TILE_NUMBITS) } else { - MoveResult { 0: self, 1: false } + MoveResult(self, false) } } pub fn grade(mut self) -> Board { @@ -224,7 +223,7 @@ impl Board { if let Some(off) = self.pos_to_off(pos) { self.data[off] ^= FLAGGED_BIT; } - MoveResult { 0: self, 1: false } + MoveResult(self, false) } pub fn render(&self) -> Vec<u8> { |