about summary refs log tree commit diff
path: root/src/libcore/iter/traits
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-4366/+0
2020-07-23Rollup merge of #74141 - euclio:typos, r=steveklabnikManish Goregaokar-1/+1
libstd/libcore: fix various typos
2020-07-17Rollup merge of #74428 - tshepang:better-filter-map-doc, r=jonas-schievinkManish Goregaokar-4/+2
docs: better demonstrate that None values are skipped as many times a… …s needed
2020-07-17Intra-doc for iter Sum and Product traitsLzu Tao-6/+6
2020-07-17Intra-doc for DoubleEndIteratorLzu Tao-4/+2
2020-07-17Intra doc for iter marker traitsLzu Tao-6/+4
2020-07-17Use intra-doc link on Iterator pageLzu Tao-56/+21
2020-07-17docs: better demonstrate that None values are skipped as many times as neededTshepang Lekhonkhobe-4/+2
2020-07-16Revert "Remove spotlight usage"Manish Goregaokar-0/+1
This reverts commit 13c6d5819aae3c0de6a90e7f17ea967bf4487cbb.
2020-07-09libstd/libcore: fix various typosAndy Russell-1/+1
2020-07-05Fix spacing in Iterator fold docIvan Tham-2/+2
2020-06-19Refactor `try_find` a littleJosh Stone-11/+18
The `E` type parameter was unnecessary, so it's now removed. The folding closure now has reduced parametricity on just `T = Self::Item`, rather than the whole `Self` iterator type. There's otherwise no functional change in this.
2020-06-14Fix iterator copied() documentation example codeSteve Heindel-2/+2
2020-05-29Add extend_one tracking issue 72631Josh Stone-2/+2
2020-05-29Use a canonical name for extend_reserve(additional)Josh Stone-1/+3
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2020-05-29Add Extend::{extend_one,extend_reserve}Josh Stone-5/+24
This adds new optional methods on `Extend`: `extend_one` add a single element to the collection, and `extend_reserve` pre-allocates space for the predicted number of incoming elements. These are used in `Iterator` for `partition` and `unzip` as they shuffle elements one-at-a-time into their respective collections.
2020-05-29Clarify the documentation of takeAlexis Bourget-0/+11
2020-05-26Add remark regarding DoubleEndedIteratorphilipp-0/+26
2020-05-18Tweak `partition`, `unzip`, `try_find`.Nicholas Nethercote-7/+7
Many default iterator methods use `try_fold` or `fold`, and these ones can too.
2020-05-18Make `fold` standalone.Nicholas Nethercote-13/+20
`fold` is currently implemented via `try_fold`, but implementing it directly results in slightly less LLVM IR being generated, speeding up compilation of some benchmarks. (And likewise for `rfold`.) The commit adds `fold` implementations to all the iterators that lack one but do have a `try_fold` implementation. Most of these just call the `try_fold` implementation directly.
2020-05-16Rollup merge of #72166 - nnethercote:simpler-slice-Iterator-methods, r=cuviperDylan DPC-1/+1
Simpler slice `Iterator` methods These reduce the amount of LLVM IR generated, helping compile times. r? @cuviper
2020-05-13Change `Iterator::nth` to use `self.next()` in a `while` loop.Nicholas Nethercote-1/+1
Currently it uses `for x in self`, which seems dubious within an iterator method. Furthermore, `self.next()` is used in all the other iterator methods.
2020-04-26Use min_specialization in liballocMatthew Jasper-0/+2
- Remove a type parameter from `[A]RcFromIter`. - Remove an implementation of `[A]RcFromIter` that didn't actually specialize anything. - Remove unused implementation of `IsZero` for `Option<&mut T>`. - Change specializations of `[A]RcEqIdent` to use a marker trait version of `Eq`. - Remove `BTreeClone`. I couldn't find a way to make this work with `min_specialization`. - Add `rustc_unsafe_specialization_marker` to `Copy` and `TrustedLen`.
2020-04-16Dogfood or_patterns in the standard libraryJosh Stone-2/+2
2020-04-03Replace float module consts with assoc consts in documentationLinus Färnstrand-3/+3
2020-04-03Replace max/min_value() with MAX/MIN assoc constsLinus Färnstrand-1/+1
2020-03-27remove unused importdylan_DPC-1/+0
2020-03-27simplify testdylan_DPC-4/+1
2020-03-26fix docsdylan_DPC-2/+5
2020-03-26Add fold_selfNathan West-16/+40
- Added `Iterator::fold_first`, which is like `fold`, but uses the first element in the iterator as the initial accumulator - Includes doc and doctest - Rebase commit; see #65222 for details Co-Authored-By: Tim Vermeulen <tvermeulen@me.com>
2020-03-22Auto merge of #68820 - WaffleLapkin:remove_finished_from_map_while, ↵bors-10/+11
r=LukasKalbertodt Remove `finished` flag from `MapWhile` This PR removes `finished` flag from `MapWhile` as been proposed in https://github.com/rust-lang/rust/pull/66577#discussion_r370958025. This also resolves open questions of the tracking issue (#68537): - `MapWhile` can't implement both + `DoubleEndedIterator` (discussed in https://github.com/rust-lang/rust/pull/66577#discussion_r370947990 and following comments) + `FusedIterator` (this pr removes `finished` flag, so `MapWhile` isn't fused anymore) - Debug output (this pr removes `finished` flag, so there is no question in including it in debug output) r? @Mark-Simulacrum
2020-03-21slightly change the `Iterator::map_while` docsWaffle-14/+4
2020-03-10Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnisonMazdak Farrokhzad-1/+0
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2020-03-03Rollup merge of #69213 - LeSeulArtichaut:improve-doc-iter, r=steveklabnikYuki Okushi-1/+3
Improve documentation on iterators length Attempts to resolve #66491. @the8472 does this help? r? @steveklabnik
2020-03-02Apply suggestions from code reviewLeSeulArtichaut-2/+3
2020-02-27docs: note that find(f) is equivalent to filter(f).next() in the iterator docs.Matthias Krüger-0/+4
2020-02-27Remove spotlight usageGuillaume Gomez-1/+0
2020-02-24adjuste doc of `map_while`Waffle-10/+6
Fix doc of `Iterator::map_while` so it would be clearer that it isn't fused.
2020-02-16Improve documentation on iteratorsLeSeulArtichaut-1/+2
2020-02-04Remove `finished` flag from `MapWhile`Waffle-0/+15
2020-01-28Fill tracking issue for `iter_map_while` featureWaffle-1/+1
2020-01-28Add `Iterator::map_while` method and corresponding `MapWhile` adapterWaffle-1/+101
2020-01-08Use matches macro in libcore and libstdIgor Aleksanov-8/+2
2020-01-06Use Self instead of $typeLzu Tao-8/+8
2020-01-02Add Iterator::try_findMOZGIII-0/+37
2019-12-24x.py fmt after previous deignoreMark Rousskov-145/+257
2019-12-22Format the worldMark Rousskov-8/+8
2019-12-06Format libcore with rustfmt (including tests and benches)David Tolnay-6/+6
2019-12-03Tweak wording of `collect()` on bad target typeEsteban Küber-2/+2
2019-11-26Format libcore with rustfmtDavid Tolnay-14/+20
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.