From: Gentoli Date: Mon, 3 Jan 2022 11:25:42 +0000 (-0500) Subject: doc: `Iterator::partition` use partial type hints X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;ds=sidebyside;h=62a65945b7380c58013c45b3cb41a484b3b8437f;hp=c274e4969f058b1c644243181ece9f829efa7594;p=rust.git doc: `Iterator::partition` use partial type hints --- 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 @@ fn try_collect(&mut self) -> ChangeOutputType /// ``` /// let a = [1, 2, 3]; /// - /// let (even, odd): (Vec, Vec) = 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]);