mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +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` loop
|
||||||
while 1 == 1 {
|
while 1 == 1 {
|
||||||
println!("The universe is operating normally.");
|
println!("The universe is operating normally.");
|
||||||
break;
|
// break statement gets out of the while loop.
|
||||||
|
// It avoids useless iterations.
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// Infinite loop
|
// Infinite loop
|
||||||
loop {
|
loop {
|
||||||
println!("Hello!");
|
println!("Hello!");
|
||||||
break;
|
// break statement gets out of the loop
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user