Function itertools::chain[][src]

pub fn chain<I, J>(
    i: I,
    j: J
) -> Chain<<I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter> where
    I: IntoIterator,
    J: IntoIterator<Item = I::Item>, 
Expand description

Create an iterator that first iterates i and then j.

IntoIterator enabled version of Iterator::chain.

use itertools::chain;

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