rust/src/libcore/iter
kennytm 562626ac3f
Rollup merge of #48115 - Centril:feature/iterator_flatten, r=alexcrichton
Add Iterator::flatten

This adds the trait method `.flatten()` on `Iterator` which flattens one level of nesting from an iterator or (into)iterators. The method `.flat_fmap(f)` is then redefined as `.map(f).flatten()`. The implementation of `Flatten` is essentially that of what it was for `FlatMap` but removing the call to `f` at various places.

Hopefully the type alias approach should be OK as was indicated / alluded to by @bluss and @eddyb in https://github.com/rust-lang/rfcs/pull/2306#issuecomment-361391370.

cc @scottmcm
2018-02-25 15:54:41 +08:00
..
iterator.rs Rollup merge of #48115 - Centril:feature/iterator_flatten, r=alexcrichton 2018-02-25 15:54:41 +08:00
mod.rs core::iter::Iterator::flatten: tracking issue is #48213 2018-02-20 08:28:54 +01:00
range.rs Auto merge of #48057 - scottmcm:less-match-more-compare, r=dtolnay 2018-02-08 06:38:30 +00:00
sources.rs core::iter::repeat_with: fix spelling, s/not/note 2018-02-16 22:14:32 +01:00
traits.rs Add Range[Inclusive]::is_empty 2018-02-09 01:47:18 -08:00