summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-04-12 19:59:52 +0200
committerGitHub <noreply@github.com>2021-04-12 19:59:52 +0200
commitb89c464bede7247b8ebe66b52109575d1d198e79 (patch)
tree7c22d85afee7687140f2c3f1f23fd19935d25159 /library/alloc/src/vec
parent5e73bd1040138f49200ce292eb109d3c8fd9a9cc (diff)
downloadrust-b89c464bede7247b8ebe66b52109575d1d198e79.tar.gz
rust-b89c464bede7247b8ebe66b52109575d1d198e79.zip
Improve code example for length comparison
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 91c3b16deee..0dab0358d6e 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2567,7 +2567,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// # let some_predicate = |x: &mut i32| { *x == 2 || *x == 3 || *x == 6 };
     /// # let mut vec = vec![1, 2, 3, 4, 5, 6];
     /// let mut i = 0;
-    /// while i != vec.len() {
+    /// while i < vec.len() {
     ///     if some_predicate(&mut vec[i]) {
     ///         let val = vec.remove(i);
     ///         // your code here