Fix tetris-logic lib

This commit is contained in:
Greg Shuflin 2024-10-03 16:52:22 -07:00
parent 2978a661d5
commit 537e6fa8ed

View File

@ -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,