mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Add gescription related break statement
Insert description related to break statement.
This commit is contained in:
parent
cd6abe0bfc
commit
501828c891
@ -260,13 +260,16 @@ fn main() {
|
||||
// `while` loop
|
||||
while 1 == 1 {
|
||||
println!("The universe is operating normally.");
|
||||
break;
|
||||
// break statement gets out of the while loop.
|
||||
// It avoids useless iterations.
|
||||
break
|
||||
}
|
||||
|
||||
// Infinite loop
|
||||
loop {
|
||||
println!("Hello!");
|
||||
break;
|
||||
// break statement gets out of the loop
|
||||
break
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user