We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91fbaf1 commit 39aeadfCopy full SHA for 39aeadf
rust/bowling/src/lib.rs
@@ -143,11 +143,8 @@ impl BowlingGame {
143
let next_frame = self.frames.get(frame_index + 1);
144
if next_frame.unwrap().is_strike() {
145
let next_next_frame = self.frames.get(frame_index + 2);
146
- if next_next_frame.is_some() {
147
- return (
148
- Some(next_frame.unwrap().roll1),
149
- Some(next_next_frame.unwrap().roll1),
150
- );
+ if let Some(nnf) = next_next_frame {
+ return (Some(next_frame.unwrap().roll1), Some(nnf.roll1));
151
} else {
152
return (Some(next_frame.unwrap().roll1), self.fill_ball1);
153
}
0 commit comments