#iterator

size_hint

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

4 releases

✓ Uses Rust 2018 edition

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

#217 in Rust patterns

12 downloads per month

MIT license

3KB
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