#iterator #own #size #hint #successor #from-fn

size_hint

A very simple library to provide a size_hint for an iterator which does not provide it's own

4 releases

0.1.3 Jun 8, 2019
0.1.2 Jun 8, 2019
0.1.1 Jun 6, 2019
0.1.0 Jun 6, 2019

#6 in #successor

MIT license

4KB
60 lines

size_hint

A very simple library to provide a size_hint for an iterator which does not provide it's own such as std::iter::{from_fn, successors}

Usage

use std::iter;
use size_hint::HintSize;
iter::successors(Some(inital_state), some_fn).hint_size(expected_items)

No runtime deps