OxL Reference

method iter.zip

Pairs of elements of self and other; ends with the shorter sequence.

Example:

oxl✓ checked in CI
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

NameType
otheriter<U>

Returns

iter<(T, U)>

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:322

See also