diff options
| author | fee1-dead <ent3rm4n@gmail.com> | 2022-03-06 22:35:29 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-06 22:35:29 +1100 |
| commit | d85e4b1e359be89ff6e55b71f54ed84c5a85d1f1 (patch) | |
| tree | a254e4fdb461b996c48163d45ef3aeb5fecbb661 | |
| parent | ad0d1d71d3bc6f85f53d8ab2bf47daa7c8bc2c51 (diff) | |
| parent | 62a65945b7380c58013c45b3cb41a484b3b8437f (diff) | |
| download | rust-d85e4b1e359be89ff6e55b71f54ed84c5a85d1f1.tar.gz rust-d85e4b1e359be89ff6e55b71f54ed84c5a85d1f1.zip | |
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.
| -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]); |
