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.
This commit is contained in:
fee1-dead 2022-03-06 22:35:29 +11:00 committed by GitHub
commit d85e4b1e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]);