Skip to content

Commit d85e4b1

Browse files
authored
Rollup merge of #92509 - Gentoli:partition-ex, r=camelid
doc: `Iterator::partition` use partial type hints Switch to partial type hints to indicate only the collection type is needed.
2 parents ad0d1d7 + 62a6594 commit d85e4b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/iter/traits/iterator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1877,9 +1877,9 @@ pub trait Iterator {
18771877
/// ```
18781878
/// let a = [1, 2, 3];
18791879
///
1880-
/// let (even, odd): (Vec<i32>, Vec<i32>) = a
1881-
/// .iter()
1882-
/// .partition(|&n| n % 2 == 0);
1880+
/// let (even, odd): (Vec<_>, Vec<_>) = a
1881+
/// .into_iter()
1882+
/// .partition(|n| n % 2 == 0);
18831883
///
18841884
/// assert_eq!(even, vec![2]);
18851885
/// assert_eq!(odd, vec![1, 3]);

0 commit comments

Comments
 (0)