about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorStefan Schindler <dns2utf8@estada.ch>2019-07-25 00:35:24 +0200
committerStefan Schindler <dns2utf8@estada.ch>2019-08-06 10:48:11 +0200
commitae1e7cace3971b2ed7e2e75fca74c554a36fbfd3 (patch)
treee2f842f2bfe982c6fb6b122416c0f737bde80ce2 /src
parent766b10a8d544550712fd6352863457a86f46db3c (diff)
downloadrust-ae1e7cace3971b2ed7e2e75fca74c554a36fbfd3.tar.gz
rust-ae1e7cace3971b2ed7e2e75fca74c554a36fbfd3.zip
Match the loop examples
Diffstat (limited to 'src')
-rw-r--r--src/libstd/keyword_docs.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs
index f5018485ef7..5ca518358d7 100644
--- a/src/libstd/keyword_docs.rs
+++ b/src/libstd/keyword_docs.rs
@@ -681,14 +681,15 @@ mod while_keyword { }
 ///     # break;
 /// }
 ///
-/// let mut i = 0;
+/// let mut i = 1;
 /// loop {
 ///     println!("i is {}", i);
-///     if i > 10 {
+///     if i > 100 {
 ///         break;
 ///     }
-///     i += 1;
+///     i *= 2;
 /// }
+/// assert_eq!(i, 128);
 /// ```
 ///
 /// Unlike the other kinds of loops in Rust (`while`, `while let`, and `for`), loops can be used as