diff --git a/src/game.rs b/src/game.rs index 3e19f1c..458b061 100644 --- a/src/game.rs +++ b/src/game.rs @@ -136,8 +136,7 @@ impl Game { // It's possible that the player moved the piece in the meantime. if !self.playfield.can_active_piece_move_down() { let positions = self.playfield.lock_active_piece(); - self.is_game_over = - self.is_game_over || positions.iter().all(|Position { x: _, y }| *y < 20); + self.is_game_over = self.is_game_over || positions.iter().map(|p| p.y).all(|y| y < 20); if self.clear_lines() > 0 { self.playfield.active_piece = None; @@ -227,9 +226,6 @@ impl Controllable for Game { } fn hold(&mut self) { - match self.playfield.try_swap_hold() { - Ok(_) => {} - Err(_) => (), - } + let _ = self.playfield.try_swap_hold(); } } diff --git a/src/srs.rs b/src/srs.rs index a0c584d..563ee0f 100644 --- a/src/srs.rs +++ b/src/srs.rs @@ -1,5 +1,5 @@ -use crate::playfield::{Matrix, PlayField}; -use crate::tetromino::{Position, RotationState, Tetromino, TetrominoType}; +use crate::playfield::PlayField; +use crate::tetromino::{Position, RotationState, TetrominoType}; use std::collections::HashMap; pub trait RotationSystem {