diff options
-rw-r--r-- | rust.html.markdown | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rust.html.markdown b/rust.html.markdown index 1c0e324c..71bc16b5 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -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 } ///////////////////////////////// |