@@ -88,9 +88,9 @@ pub enum GameStatus {
8888/// The outcome of a single move/step.
8989enum StepOutcome {
9090 /// Grid full (player wins)
91- Full ( Coords ) ,
91+ Full ,
9292 /// Snake has collided with itself (player loses)
93- Collision ( Coords ) ,
93+ Collision ,
9494 /// Snake has eaten some food
9595 Eat ( Coords ) ,
9696 /// Snake has moved (and nothing else has happened)
@@ -248,13 +248,13 @@ impl Game {
248248 // won't actually be any collision (as the tail will have moved by the time the head
249249 // moves onto the tile)
250250 if next_move != * self . snake . tail . peek ( ) . unwrap ( ) {
251- StepOutcome :: Collision ( next_move )
251+ StepOutcome :: Collision
252252 } else {
253253 StepOutcome :: Move ( next_move)
254254 }
255255 } else if next_move == self . food_coords {
256256 if self . snake . tail . len ( ) == 23 {
257- StepOutcome :: Full ( next_move )
257+ StepOutcome :: Full
258258 } else {
259259 StepOutcome :: Eat ( next_move)
260260 }
@@ -266,8 +266,8 @@ impl Game {
266266 /// Handle the outcome of a step, updating the game's internal state.
267267 fn handle_step_outcome ( & mut self , outcome : StepOutcome ) {
268268 self . status = match outcome {
269- StepOutcome :: Collision ( _ ) => GameStatus :: Lost ,
270- StepOutcome :: Full ( _ ) => GameStatus :: Won ,
269+ StepOutcome :: Collision => GameStatus :: Lost ,
270+ StepOutcome :: Full => GameStatus :: Won ,
271271 StepOutcome :: Eat ( c) => {
272272 self . snake . move_snake ( c, true ) ;
273273 self . place_food ( ) ;
@@ -333,4 +333,4 @@ impl Game {
333333 }
334334 values
335335 }
336- }
336+ }
0 commit comments