about summary refs log tree commit diff
path: root/src/libcore/iter
AgeCommit message (Collapse)AuthorLines
2019-02-02Update visibility of intermediate use items.David Wood-0/+3
Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This commit ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
2019-02-01Rename iter::unfold to iter::from_fn and remove explicit stateSimon Sapin-32/+25
This API is unstable. CC https://github.com/rust-lang/rust/issues/55977#issuecomment-459657195
2019-01-22Move trivial constructors to inherent methodsClar Fon-26/+76
2019-01-22Move nontrivial constructors to inherent methodsClar Fon-25/+60
2019-01-22Don't expose ZipImpl to IteratorClar Fon-5/+5
2019-01-22Move super_nth out of ZipImplClar Fon-7/+9
2019-01-22Don't expose FlattenCompat to IteratorClar Fon-13/+24
2019-01-22Don't expose ChainState to IteratorClar Fon-8/+12
2019-01-22Move Flatten and FlatMap to own moduleClar Fon-313/+321
2019-01-22Move Chain and ChainState to own moduleClar Fon-251/+258
2019-01-22Move TrustedRandomAccess into Zip moduleClar Fon-2/+19
2019-01-22Move Zip and ZipImpl to own moduleClar Fon-258/+266
2019-01-22Move FusedIterator, TrustedLen to own moduleClar Fon-45/+46
2019-01-22Move Sum, Product to own moduleClar Fon-226/+227
2019-01-22Move FromIterator, IntoIterator, Extend into own moduleClar Fon-350/+351
2019-01-22Move ExactSizeIterator to own moduleClar Fon-143/+145
2019-01-22Move DoubleEndedIterator to own moduleClar Fon-298/+300
2019-01-22Move core::iter iterator.rs to traits moduleClar Fon-8/+11
2019-01-22Move core::iter adapters to adapters.rsClar Fon-2769/+2790
2019-01-17Compare pairs with `slice::windows`Kevin Leimkuhler-1/+4
2019-01-17Improve documentation and slice implKevin Leimkuhler-2/+6
2019-01-17Add is_sorted unstable documentationKevin Leimkuhler-0/+2
2019-01-17Add is_sorted impl for [T]Kevin Leimkuhler-20/+16
2019-01-17Add initial impl of is_sorted to IteratorKevin Leimkuhler-0/+84
2019-01-15Rollup merge of #57608 - timvisee:master, r=frewsxcvMazdak Farrokhzad-1/+1
Simplify 'product' factorial example This simplifies the [`factorial(n: 32)`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#examples-46) implementation as example for the `Iterator::product()` function. It currently uses unnecessary additional complexity. Although very minimal, I do not want to include it in some other irrelevant PR.
2019-01-15Rollup merge of #57579 - stjepang:once-with, r=SimonSapinMazdak Farrokhzad-0/+115
Add core::iter::once_with() Functions `iter::once()` and `iter::repeat()` construct iterators from values. The latter has the lazy variant `iter::repeat_with()`, but the former doesn't. This PR therefore adds `iter::once_with()`. Another way to think of `iter::once_with()` is that it's a function that converts `FnOnce() -> T` into `Iterator<Item = T>`. If this seems like a reasonable addition, I'll open a tracking issue and update the `#[feature(...)]` attributes.
2019-01-14Simplify 'product' factorial exampletimvisee-1/+1
2019-01-14Add another feature(iter_once_with)Stjepan Glavina-0/+2
2019-01-14Add feature(iter_once_with)Stjepan Glavina-0/+2
2019-01-13Fix intradoc link and update issue numberStjepan Glavina-8/+9
2019-01-13Add core::iter::once_withStjepan Glavina-0/+110
2019-01-13Change #[must_use] message of Iterator in documentationTaiki Endo-1/+1
2019-01-13Change #[must_use] message of IteratorTaiki Endo-22/+22
2019-01-13Add #[must_use] message to Iterator and FutureTaiki Endo-1/+1
2018-12-26Auto merge of #56534 - xfix:copied, r=@SimonSapinbors-1/+130
Add unstable Iterator::copied() Initially suggested at https://github.com/bluss/rust-itertools/pull/289, however the maintainers of itertools suggested this may be better of in a standard library. The intent of `copied` is to avoid accidentally cloning iterator elements after doing a code refactoring which causes a structure to be no longer `Copy`. This is a relatively common pattern, as it can be seen by calling `rg --pcre2 '[.]map[(][|](?:(\w+)[|] [*]\1|&(\w+)[|] \2)[)]'` on Rust main repository. Additionally, many uses of `cloned` actually want to simply `Copy`, and changing something to be no longer copyable may introduce unnoticeable performance penalty. Also, this makes sense because the standard library includes `[T].copy_from_slice` to pair with `[T].clone_from_slice`. This also adds `Option::copied`, because it makes sense to pair it with `Iterator::copied`. I don't think this feature is particularly important, but it makes sense to update `Option` along with `Iterator` for consistency.
2018-12-26Add a tracking issue for Iterator::copiedKonrad Borowski-7/+7
2018-12-25Remove licensesMark Rousskov-49/+0
2018-12-24Rollup merge of #56242 - GuillaumeGomez:iterator-missing-link, r=CentrilMazdak Farrokhzad-1/+1
Add missing link in docs r? @steveklabnik
2018-12-23Merge branch 'master' into copiedKonrad Borowski-32/+103
2018-12-20Add DoubleEndedIterator::nth_backClar Fon-6/+79
2018-12-19Rollup merge of #56907 - rumajo:master, r=kennytm,CentrilPietro Albini-1/+1
Fix grammar in compiler error for array iterators This fixes a small grammatical mistake in the message the compiler gives when attempting to iterate directly over an array `arr` without calling `arr.iter()` or borrowing `&arr`.
2018-12-17Auto merge of #56904 - sinkuu:cycle_fold, r=blussbors-13/+0
Remove Cycle::try_fold override Fixes #56883
2018-12-17Remove `<Cycle as Iterator>::try_fold` overrideShotaro Yamada-13/+0
It was a incorrect optimization.
2018-12-17Fix grammar in compiler error for array iteratorsMatthew Russell-1/+1
2018-12-10Add #[must_use] attribute to stdlib traitsFelix Chapman-0/+1
2018-12-09Auto merge of #56630 - sinkuu:core_iter, r=kennytmbors-22/+30
Resolve FIXME in libcore/iter/mod.rs and makes a few improvements.
2018-12-09Don't call size_hint of underlying iterator needlesslyShotaro Yamada-2/+10
2018-12-09Resolve FIXME and cleanupShotaro Yamada-20/+7
2018-12-09Override Cycle::try_foldShotaro Yamada-0/+13
name old ns/iter new ns/iter diff ns/iter diff % speedup iter::bench_cycle_take_ref_sum 927,152 927,194 42 0.00% x 1.00 iter::bench_cycle_take_sum 938,129 603,492 -334,637 -35.67% x 1.55
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2