You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem:
There is nothing mentioned about how you return (loop break) a value from a loop you are breaking that has a label.
Suggested fix:
Add example on how you return (loop break) a value from a labeled loop, as the page describes both loop break returning a value and breaking from a loop with a label, and it's not immediately obvious how you both break from a labeled loop and return a value from the loop scope at the same time.
main
branch to see if this has already been fixed, in this file:src/ch03-05-control-flow.md
URL to the section(s) of the book with this problem:
https://github.com/rust-lang/book/blob/main/src/ch03-05-control-flow.md
https://doc.rust-lang.org/book/ch03-05-control-flow.html
Description of the problem:
There is nothing mentioned about how you return (loop break) a value from a loop you are breaking that has a label.
Suggested fix:
Add example on how you return (loop break) a value from a labeled loop, as the page describes both loop break returning a value and breaking from a loop with a label, and it's not immediately obvious how you both break from a labeled loop and return a value from the loop scope at the same time.
People on StackOverflow asking about this same issue:
https://stackoverflow.com/questions/72927882/return-a-value-from-labeled-loops
The text was updated successfully, but these errors were encountered: