summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-04-26 10:10:51 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-05-10 14:30:15 -0400
commitdb1dc5d1e6bf2c6284a3f5d0f41f5b0912bf97b1 (patch)
treebb8a4dfcd29daa54b5dba4ecfb410dff2980515e /src
parent41bcb828f4c2fcc0a28b8fa48467e6f51d6ab32e (diff)
downloadrust-db1dc5d1e6bf2c6284a3f5d0f41f5b0912bf97b1.tar.gz
rust-db1dc5d1e6bf2c6284a3f5d0f41f5b0912bf97b1.zip
Utilize `while let` instead of `loop` with `break` in doc-comment
Diffstat (limited to 'src')
-rw-r--r--src/libcollections/vec.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index a8105d976e5..7f3cf77ce86 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);
 /// }