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()}")
}Вывод
[(1, "a"), (2, "b")]
pub(api) move fn zip<U>(other: iter<U>) -> iter<(T, U)>Сложность. O(1) per element.
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
other | iter<U> |
Возвращает
iter<(T, U)>
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/iter.oxl:322