You've already forked comprehensive-rust
							
							
				mirror of
				https://github.com/google/comprehensive-rust.git
				synced 2025-10-31 08:37:45 +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:
		| @@ -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> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user