mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 11:12:43 +00:00
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:
commit
c96a677c39
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user