mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-08 17:01:32 +02:00
update break-continue.md (#2287)
Move the speak note about "loop" into the page which we actually talk about "loop". Also update the wording to make it more accurate. --------- Co-authored-by: Jason Lin <lxj@google.com>
This commit is contained in:
parent
e282cb2002
commit
590a88fc3d
@ -27,3 +27,12 @@ fn main() {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
Note that `loop` is the only looping construct which can returns a non-trivial
|
||||
value. This is because it's guaranteed to only return at a `break` statement
|
||||
(unlike `while` and `for` loops, which can also return when the condition
|
||||
fails).
|
||||
|
||||
</details>
|
||||
|
@ -19,11 +19,3 @@ fn main() {
|
||||
print!("elements searched: {elements_searched}");
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
- Note that `loop` is the only looping construct which returns a non-trivial
|
||||
value. This is because it's guaranteed to be entered at least once (unlike
|
||||
`while` and `for` loops).
|
||||
|
||||
</details>
|
||||
|
Loading…
Reference in New Issue
Block a user