Skip to content

Commit ae1e7ca

Browse files
committed
Match the loop examples
1 parent 766b10a commit ae1e7ca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libstd/keyword_docs.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -681,14 +681,15 @@ mod while_keyword { }
681681
/// # break;
682682
/// }
683683
///
684-
/// let mut i = 0;
684+
/// let mut i = 1;
685685
/// loop {
686686
/// println!("i is {}", i);
687-
/// if i > 10 {
687+
/// if i > 100 {
688688
/// break;
689689
/// }
690-
/// i += 1;
690+
/// i *= 2;
691691
/// }
692+
/// assert_eq!(i, 128);
692693
/// ```
693694
///
694695
/// Unlike the other kinds of loops in Rust (`while`, `while let`, and `for`), loops can be used as

0 commit comments

Comments
 (0)