Function x11rb_protocol::resource_manager::matcher::zip_longest::zip_longest
source ยท pub(super) fn zip_longest<'a, T>(
a: &'a [T],
b: &'a [T],
) -> impl Iterator<Item = (Option<&'a T>, Option<&'a T>)> + 'a
Expand description
Given two slices, produce an iterator that zips the two slices.
Compared to std::iter::Iterator::zip(), this iterator does not stop at the end of the
shorter of the two slices, but instead continues to the end of the longer slice. To make
this possible, the individual items are wrapped in Option
.
See tests below to make this clearer.