We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f342b42 commit 2abbae1Copy full SHA for 2abbae1
rust/bowling/src/lib.rs
@@ -94,11 +94,9 @@ impl BowlingGame {
94
self.frames.push(frame);
95
return Ok(())
96
}
97
- if self.pending_roll.is_some() {
98
- let roll1 = self.pending_roll.unwrap();
99
- let frame = Frame::new(roll1, pins);
+ if let Some(prev) = self.pending_roll.take() {
+ let frame = Frame::new(prev, pins);
100
101
- self.pending_roll = None;
102
103
} else {
104
self.pending_roll = Some(pins);
0 commit comments