Crate collect_exact

Crate collect_exact 

Source
Expand description

Allows zero-cost collection into exact-size arrays and tuples.

§Usage

use collect_exact::CollectExact;

let iter = [1, 2, 3].into_iter();
let result = iter.collect_exact::<[u32; 3]>();

assert_eq!(result, Ok([1, 2, 3]));

Structs§

PrefixError
Error that is returned when the iterator has too few items.

Enums§

Error
Error that is returned when the iterator does not have exactly the right number of items.

Traits§

CollectExact
Extension trait for collecting into collections whose length is known at compile time.
FromIteratorExact
Conversion from an Iterator for a collection whose length is known at compile time.