1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-07-31 03:50:32 +02:00

Add gescription related break statement

Insert description related to break statement.
This commit is contained in:
Anatolij
2018-09-20 13:04:31 +02:00
committed by GitHub
parent cd6abe0bfc
commit 501828c891

View File

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