diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-30 23:07:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-30 23:07:57 +0200 |
| commit | c96a677c39684585cc7fa17f9f0514a6c4c0372f (patch) | |
| tree | 98072dc98823914865949f88b74c3a0861c21aff | |
| parent | ecca4b8c4bea678615175e1673ffcb647a94eb4a (diff) | |
| parent | ae1e7cace3971b2ed7e2e75fca74c554a36fbfd3 (diff) | |
| download | rust-c96a677c39684585cc7fa17f9f0514a6c4c0372f.tar.gz rust-c96a677c39684585cc7fa17f9f0514a6c4c0372f.zip | |
Rollup merge of #62957 - dns2utf8:doc_loop_keyword, r=GuillaumeGomez
Match the loop examples The idea is to show the usefulness of the expression side by side.
| -rw-r--r-- | src/libstd/keyword_docs.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index 85a9dea09ed..a8dfe924fdf 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 |
