1
Fork 0

Match the loop examples

This commit is contained in:
Stefan Schindler 2019-07-25 00:35:24 +02:00
parent 766b10a8d5
commit ae1e7cace3

View file

@ -681,14 +681,15 @@ mod while_keyword { }
/// # break; /// # break;
/// } /// }
/// ///
/// let mut i = 0; /// let mut i = 1;
/// loop { /// loop {
/// println!("i is {}", i); /// println!("i is {}", i);
/// if i > 10 { /// if i > 100 {
/// break; /// 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 /// Unlike the other kinds of loops in Rust (`while`, `while let`, and `for`), loops can be used as