1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-08 00:57:56 +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:
Jason Lin 2024-08-21 16:33:50 +10:00 committed by GitHub
parent e282cb2002
commit 590a88fc3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 8 deletions

View File

@ -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>

View File

@ -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>