Skip to content

Commit 5bcaf04

Browse files
authored
Rollup merge of #90034 - moxian:unzip-doc, r=cuviper
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.
2 parents a3a6b49 + 1519ca9 commit 5bcaf04

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/iter/traits/iterator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2837,12 +2837,12 @@ pub trait Iterator {
28372837
/// Basic usage:
28382838
///
28392839
/// ```
2840-
/// let a = [(1, 2), (3, 4)];
2840+
/// let a = [(1, 2), (3, 4), (5, 6)];
28412841
///
28422842
/// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
28432843
///
2844-
/// assert_eq!(left, [1, 3]);
2845-
/// assert_eq!(right, [2, 4]);
2844+
/// assert_eq!(left, [1, 3, 5]);
2845+
/// assert_eq!(right, [2, 4, 6]);
28462846
///
28472847
/// // you can also unzip multiple nested tuples at once
28482848
/// let a = [(1, (2, 3)), (4, (5, 6))];

0 commit comments

Comments
 (0)