diff options
| author | moxian <aleftmail@inbox.ru> | 2021-10-19 00:03:51 +0000 |
|---|---|---|
| committer | moxian <aleftmail@inbox.ru> | 2021-10-19 00:03:51 +0000 |
| commit | 1519ca99d8020f4d2e4fb04a3eb425b97e457d18 (patch) | |
| tree | 4a38e0febf2a07072f305463e17add446da6496f | |
| parent | bd41e09da334697c0f993b36685cb599061d9faa (diff) | |
| download | rust-1519ca99d8020f4d2e4fb04a3eb425b97e457d18.tar.gz rust-1519ca99d8020f4d2e4fb04a3eb425b97e457d18.zip | |
Tiny tweak to Iterator::unzip() doc comment example.
It's easier to figure out what it's doing and which output elements map to which input ones if the matrix we are dealing with is rectangular 2x3 rather than square 2x2.
| -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 f53d6cac7ed..d957a7527cf 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -2837,12 +2837,12 @@ pub trait Iterator { /// Basic usage: /// /// ``` - /// let a = [(1, 2), (3, 4)]; + /// let a = [(1, 2), (3, 4), (5, 6)]; /// /// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip(); /// - /// assert_eq!(left, [1, 3]); - /// assert_eq!(right, [2, 4]); + /// assert_eq!(left, [1, 3, 5]); + /// assert_eq!(right, [2, 4, 6]); /// /// // you can also unzip multiple nested tuples at once /// let a = [(1, (2, 3)), (4, (5, 6))]; |
