You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-17 14:47:35 +02:00
Add speaker note about returning values from loop
This commit is contained in:
@ -21,4 +21,9 @@ fn main() {
|
|||||||
- The `loop` statement works like a `while true` loop. Use it for things like
|
- The `loop` statement works like a `while true` loop. Use it for things like
|
||||||
servers which will serve connections forever.
|
servers which will serve connections forever.
|
||||||
|
|
||||||
|
## More to Explore
|
||||||
|
|
||||||
|
- `loop` is the only form of loop that can return a value. If students are
|
||||||
|
curious, demonstrate breaking with a value, e.g. `break x + 10`.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
Reference in New Issue
Block a user