Remaining flow control in RBE

This commit is contained in:
2023-09-30 19:51:09 -04:00
parent dacbddca6e
commit b94fb3b31e
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
fn main() {
let mut optional = Some(0);
while let Some(i) = optional {
if i > 9 {
println!("Greater than 9, quit!");
optional = None;
} else {
println!("`i` is `{:?}`. Try again.", i);
optional = Some(i + 1);
}
}
}