Reverse condition in Vec::retain_mut doctest
This commit is contained in:
parent
c067287049
commit
1a41a665cf
@ -1470,11 +1470,11 @@ impl<T, A: Allocator> Vec<T, A> {
|
||||
///
|
||||
/// ```
|
||||
/// let mut vec = vec![1, 2, 3, 4];
|
||||
/// vec.retain_mut(|x| if *x > 3 {
|
||||
/// false
|
||||
/// } else {
|
||||
/// vec.retain_mut(|x| if *x <= 3 {
|
||||
/// *x += 1;
|
||||
/// true
|
||||
/// } else {
|
||||
/// false
|
||||
/// });
|
||||
/// assert_eq!(vec, [2, 3, 4]);
|
||||
/// ```
|
||||
|
Loading…
x
Reference in New Issue
Block a user