rust-lang/rust — pull request #19283 by SimonSapin (2014-11-24 22:22:20+00:00)
Title: Add `Iterator::zip_longest`.

Like `Iterator::zip`, but the returned iterator is as long as the longest of the input iterators rather than shortest, and yields `(Option, Option)` (which can not both be `None`) rather than `(A, B)`.

An alternative could be to yield a new `EitherOrBoth` (?) enum that is either `Both(A, B)`, `Left(A)`, or `Right(B)`.

Precedent: https://docs.python.org/library/itertools.html#itertools.izip_longest