diff --git a/iced-tetris/tetris-logic/src/lib.rs b/iced-tetris/tetris-logic/src/lib.rs index b5638ca..9ca80ac 100644 --- a/iced-tetris/tetris-logic/src/lib.rs +++ b/iced-tetris/tetris-logic/src/lib.rs @@ -10,7 +10,7 @@ pub struct BlockGrid { impl BlockGrid { pub fn new() -> BlockGrid { - let mut state = [[None; 20]; 10]; + let state = [[None; 20]; 10]; BlockGrid { state, active_piece: None, @@ -23,7 +23,7 @@ impl BlockGrid { /// If it's impossible to drop a piece, return false pub fn drop_piece(&mut self, tetromino: Tetromino) -> bool { - if let None = self.active_piece { + if self.active_piece.is_none() { let piece = ActivePiece { location: START_LOCATION, tetromino,