method iter.zip
Pairs of elements of self and other; ends with the shorter sequence.
Example:
fn main() io {
print("{[1, 2, 3].iter().zip(["a", "b"].iter()).collect()}")
}Output
[(1, "a"), (2, "b")]
pub(api) move fn zip<U>(other: iter<U>) -> iter<(T, U)>Complexity. O(1) per element.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
other | iter<U> |
Returns
iter<(T, U)>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:322