From a249910d3417160e2f871bc5a5200bec6b11f518 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 26 Apr 2015 10:10:51 -0400 Subject: [PATCH] Utilize `while let` instead of `loop` with `break` in doc-comment --- src/libcollections/vec.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 526150915a705..c8a8498d2f929 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -116,11 +116,7 @@ static MAX_MEMORY_SIZE: usize = isize::MAX as usize; /// stack.push(2); /// stack.push(3); /// -/// loop { -/// let top = match stack.pop() { -/// None => break, // empty -/// Some(x) => x, -/// }; +/// while let Some(top) = stack.pop() { /// // Prints 3, 2, 1 /// println!("{}", top); /// }