diff options
| -rw-r--r-- | library/core/src/iter/traits/iterator.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 5a361edecd9..f5c0a3b5cd8 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -1877,9 +1877,9 @@ pub trait Iterator { /// ``` /// let a = [1, 2, 3]; /// - /// let (even, odd): (Vec<i32>, Vec<i32>) = a - /// .iter() - /// .partition(|&n| n % 2 == 0); + /// let (even, odd): (Vec<_>, Vec<_>) = a + /// .into_iter() + /// .partition(|n| n % 2 == 0); /// /// assert_eq!(even, vec![2]); /// assert_eq!(odd, vec![1, 3]); |
