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.
This commit is contained in:
Mazdak Farrokhzad 2019-08-30 23:07:57 +02:00 committed by GitHub
commit c96a677c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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