This crate makes it possible to initialise arrays from iterators.
Examples:
use FromIterator;
let iter = .map;
let array = from_iter;
assert_eq!;
use FromIterator;
let first = vec!.into_iter;
let even_fibonaccis = first.filter;
let array = from_iter;
use FromIterator;
let short_iterator = vec!.into_iter;
let long_array = match <> try_from_iter ;
Note that the from_iter
method will panic if the iterator does not provide
enough elements to fill the entire array. To avoid this, consider using the
try_from_iter
method instead.
Both methods will ignore any extra elements in the iterator.