summaryrefslogtreecommitdiffhomepage
path: root/rust.html.markdown
diff options
context:
space:
mode:
authorAnatolij <java1cprog@yandex.ru>2018-09-20 13:04:31 +0200
committerGitHub <noreply@github.com>2018-09-20 13:04:31 +0200
commit501828c89180d88183aa05749911f4e660878c23 (patch)
treec6b6ae85dc15260e1a3b59c68f4e6f515076b6b1 /rust.html.markdown
parentcd6abe0bfcf6f34cec65b12324cebee666e0a19a (diff)
Add gescription related break statement
Insert description related to break statement.
Diffstat (limited to 'rust.html.markdown')
-rw-r--r--rust.html.markdown7
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
}
/////////////////////////////////