Skip to content

Commit b89c464

Browse files
Improve code example for length comparison
1 parent 5e73bd1 commit b89c464

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/vec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2567,7 +2567,7 @@ impl<T, A: Allocator> Vec<T, A> {
25672567
/// # let some_predicate = |x: &mut i32| { *x == 2 || *x == 3 || *x == 6 };
25682568
/// # let mut vec = vec![1, 2, 3, 4, 5, 6];
25692569
/// let mut i = 0;
2570-
/// while i != vec.len() {
2570+
/// while i < vec.len() {
25712571
/// if some_predicate(&mut vec[i]) {
25722572
/// let val = vec.remove(i);
25732573
/// // your code here

0 commit comments

Comments
 (0)