Skip to content

Commit a249910

Browse files
committed
Utilize while let instead of loop with break in doc-comment
1 parent 6365080 commit a249910

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/libcollections/vec.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ static MAX_MEMORY_SIZE: usize = isize::MAX as usize;
116116
/// stack.push(2);
117117
/// stack.push(3);
118118
///
119-
/// loop {
120-
/// let top = match stack.pop() {
121-
/// None => break, // empty
122-
/// Some(x) => x,
123-
/// };
119+
/// while let Some(top) = stack.pop() {
124120
/// // Prints 3, 2, 1
125121
/// println!("{}", top);
126122
/// }

0 commit comments

Comments
 (0)