Improve code example for length comparison

This commit is contained in:
Guillaume Gomez 2021-04-12 19:59:52 +02:00 committed by GitHub
parent 5e73bd1040
commit b89c464bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2567,7 +2567,7 @@ pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoI
/// # 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