Rollup merge of #77697 - WaffleLapkin:iter_split_adaptors, r=m-ou-se

Split each iterator adapter and source into individual modules

This PR creates individual modules for each iterator adapter and iterator source.

This is done to enhance the readability of corresponding modules (`adapters/mod.rs` and `sources.rs`) which were hard to navigate and read because of lots of repeated lines (e.g.: `adapters/mod.rs` was 3k lines long). This is also in line with some adapters which already had their own modules (`Flatten`, `FlatMap`, `Chain`, `Zip`, `Fuse`).

This PR also makes `Take`s adapter fields private (I have no idea why they were `pub(super)` before).

r? ``@LukasKalbertodt``
This commit is contained in:
Mara Bos 2020-11-22 23:00:55 +01:00 committed by GitHub
commit 4407049fcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 3575 additions and 3467 deletions

View file

@ -13,11 +13,13 @@ error[E0599]: no method named `collect` found for struct `Cloned<TakeWhile<&mut
LL | .collect();
| ^^^^^^^ method not found in `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>`
|
::: $SRC_DIR/core/src/iter/adapters/mod.rs:LL:COL
::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
|
LL | pub struct Cloned<I> {
| -------------------- doesn't satisfy `_: Iterator`
...
|
::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
|
LL | pub struct TakeWhile<I, P> {
| -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_`
|

View file

@ -15,7 +15,7 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
| doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
| doesn't satisfy `_: FnMut<(&&str,)>`
|
::: $SRC_DIR/core/src/iter/adapters/mod.rs:LL:COL
::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
|
LL | pub struct Filter<I, P> {
| ----------------------- doesn't satisfy `_: Iterator`