Function itertools::enumerate [] [src]

Important traits for Enumerate<I>
pub fn enumerate<I>(iterable: I) -> Enumerate<I::IntoIter> where
    I: IntoIterator

Iterate iterable with a running index.

IntoIterator enabled version of .enumerate().

use itertools::enumerate;

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