Skip to content

iter

Helpers for any Iterator, not only slices: work on a lazy, single-use or unbounded source.

Cargo feature iter (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features iter

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.5", default-features = false, features = ["iter"] }

Import path: helpers4::iter.

ItemWhat it does
chunkSplits iter into consecutive chunks of size items, the last one possibly shorter.
first_duplicateReturns the first item of iter that has already appeared earlier in it, or None when every item is unique.
min_maxReturns the smallest and largest item of iter in one pass, or None when it is empty.