doc: Iterator::partition
use partial type hints
This commit is contained in:
parent
c274e4969f
commit
62a65945b7
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue