summaryrefslogtreecommitdiff
path: root/src/minesweeper.rs
diff options
context:
space:
mode:
authorstale <redkugelblitzin@gmail.com>2022-06-30 07:18:45 -0300
committerstale <redkugelblitzin@gmail.com>2022-06-30 07:18:45 -0300
commit9a745bb56d592f9b02f94c1d681fe607670fae02 (patch)
treec8d0ba62c39b22fc3f1c20d88fa1178b8f03f68d /src/minesweeper.rs
parentf70c1df91afa0a211de0b743da6c0dad59fd23be (diff)
clippy fixes and version bumpHEADmaster
Diffstat (limited to 'src/minesweeper.rs')
-rw-r--r--src/minesweeper.rs9
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> {