mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
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:
commit
d85e4b1e35
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user