From 537e6fa8edfb4136b23f304132d14154967cfd2c Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Thu, 3 Oct 2024 16:52:22 -0700 Subject: [PATCH] Fix tetris-logic lib --- iced-tetris/tetris-logic/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,