Function itertools::interleave [] [src]

Important traits for Interleave<I, J>
pub fn interleave<I, J>(
    i: I,
    j: J
) -> Interleave<<I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter> where
    I: IntoIterator,
    J: IntoIterator<Item = I::Item>, 

Create an iterator that interleaves elements in i and j.

IntoIterator enabled version of i.interleave(j).

use itertools::interleave;

for elt in interleave(&[1, 2, 3], &[2, 3, 4]) {
    /* loop body */
}