about summary refs log tree commit diff
path: root/src/libcore/iter
AgeCommit message (Collapse)AuthorLines
2017-05-31Deprecate Range*::step_byScott McMurray-0/+6
Changed all the tests except test_range_step to use Iterator::step_by.
2017-05-31Rollup merge of #42329 - rap2hpoutre:patch-6, r=steveklabnikMark Simulacrum-2/+2
fix links to "module-level documentation" see https://github.com/rust-lang/rust/issues/42267
2017-05-31fix links to "module-level documentation"Raphaël Huchet-2/+2
2017-05-30RangeFrom should have an infinite size_hintScott McMurray-1/+7
This makes the size_hint from things like `take` more precise.
2017-05-28Auto merge of #42167 - scottmcm:iter-stepby-sizehint, r=alexcrichtonbors-1/+20
Override size_hint and propagate ExactSizeIterator for iter::StepBy Generally useful, but also a prerequisite for moving a bunch of unit tests off `Range*::step_by`. A small non-breaking subset of https://github.com/rust-lang/rust/pull/42110 (which I closed). Includes two small documentation changes @ivandardi requested on that PR. r? @alexcrichton
2017-05-26Auto merge of #42245 - frewsxcv:rollup, r=frewsxcvbors-5/+5
Rollup of 7 pull requests - Successful merges: #42169, #42215, #42216, #42224, #42230, #42236, #42241 - Failed merges:
2017-05-26Rollup merge of #42169 - scottmcm:new-step-trait-issue, r=alexcrichtonCorey Farwell-5/+5
Give step_trait a distinct tracking issue from step_by iterator_step_by has decoupled their futures, so the tracking issue should split. Old issue: https://github.com/rust-lang/rust/issues/27741 New issue: https://github.com/rust-lang/rust/issues/42168 r? @alexcrichton (another follow-up to closed PR https://github.com/rust-lang/rust/pull/42110#issuecomment-303176049)
2017-05-26Auto merge of #42014 - tbu-:pr_scan_not_fused, r=alexcrichtonbors-4/+0
Remove `FusedIterator` implementation of `iter::Scan` Fixes #41964. This is a breaking change.
2017-05-24Rollup merge of #42134 - scottmcm:rangeinclusive-struct, r=aturonMark Simulacrum-119/+55
Make RangeInclusive just a two-field struct Not being an enum improves ergonomics and consistency, especially since NonEmpty variant wasn't prevented from being empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait. Implements merged https://github.com/rust-lang/rfcs/pull/1980; tracking issue https://github.com/rust-lang/rust/issues/28237. This is definitely a breaking change to anything consuming `RangeInclusive` directly (not as an Iterator) or constructing it without using the sugar. Is there some change that would make sense before this so compilation failures could be compatibly fixed ahead of time? r? @aturon (as FCP proposer on the RFC)
2017-05-23Give step_trait a distinct tracking issue from step_byScott McMurray-5/+5
iterator_step_by has decoupled their futures, so the tracking issue should split.
2017-05-23Update description of iter::StepByScott McMurray-1/+1
2017-05-23Override size_hint and propagate ExactSizeIterator for iter::StepByScott McMurray-0/+19
Generally useful, but also a prerequisite for moving a bunch of unit tests off Range::step_by.
2017-05-21Return a correct size_hint for degenerate inclusive rangesScott McMurray-0/+4
Fixes https://github.com/rust-lang/rust/issues/42135 Found while fixing run-pass/range_inclusive test failure.
2017-05-21Make RangeInclusive just a two-field structScott McMurray-120/+52
Not being an enum improves ergonomics, especially since NonEmpty could be Empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait. Implements RFC 1980
2017-05-20Auto merge of #42111 - ollie27:stab, r=Mark-Simulacrumbors-1/+1
Correct some stability versions These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-20Correct some stability versionsOliver Middleton-1/+1
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-19Auto merge of #41439 - ivandardi:master, r=BurntSushibors-2/+70
Stabilize step_by by adding it to Iterator (issue #27741) Inspired by itertools' `take()` method. See issue #27741
2017-05-15Update documentationIvan Dardi-2/+1
2017-05-15Remove `FusedIterator` implementation of `iter::Scan`Tobias Bucher-4/+0
Fixes #41964. This is a breaking change.
2017-05-12Fix commit derp and update implementations and documentationIvan Dardi-2/+71
2017-05-11Fix typo in size_hint example commentMartin Glagla-1/+1
2017-04-26Rollup merge of #41493 - scottmcm:fix-step-replace, r=sfacklerAriel Ben-Yehuda-6/+6
Step::replace_one should put a one, not a zero (Issue #41492) Turns out all six of the replace_* impls were backwards.
2017-04-25Clarify "side effect" in peek's docssteveklabnik-2/+3
Fixes #33269
2017-04-23Step::replace_one should put a one, not a zero (Issue #41492)Scott McMurray-6/+6
Turns out all six of these impls are incorrect.
2017-04-15code formatking6cong-5/+5
2017-04-11Clarify Iterator::position docSebastian Hahn-2/+6
Extend the example a little bit to show behaviour better.
2017-04-03iter: Simplification in rfind's provided implementationUlrik Sverdrup-1/+1
- Prefer simpler constructs instead of going through &mut I's Iterator implementation.
2017-04-03iter: Use underlying find/rfind for the same methods in RevUlrik Sverdrup-0/+12
2017-03-23Rollup merge of #40715 - manuel-rhdt:patch-1, r=brsonCorey Farwell-3/+3
Fix doc error for ExactSizeIterator The code example in the trait documentation of ExactSizeIterator has an incorrect implementation of the len method that does not return the number of times the example iterator 'Counter' will iterate. This may confuse readers of the docs as the example code will compile but doesn't uphold the trait's contract. This is easily fixed by modifying the implementation of len and changing the assert statement to actually assert the correct behaviour. I also slightly modified a code comment to better reflect what the method returns.
2017-03-21Fix doc error for ExactSizeIteratorManuel-3/+3
The code example in the trait documentation of ExactSizeIterator has an incorrect implementation of the len method that does not return the number of times the example iterator 'Counter' will iterate. This may confuse readers of the docs as the example code will compile but doesn't uphold the trait's contract. This is easily fixed by modifying the implementation of len and changing the assert statement to actually assert the correct behaviour. I also slightly modified a code comment to better reflect what the method returns.
2017-03-21Fix invalid linking in iter docsGuillaume Gomez-3/+3
2017-03-20Fix up various linkssteveklabnik-2/+2
The unstable book, libstd, libcore, and liballoc all needed some adjustment.
2017-03-17Rollup merge of #40456 - frewsxcv:frewsxcv-docs-function-parens, ↵Corey Farwell-128/+128
r=GuillaumeGomez Remove function invokation parens from documentation links. This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-128/+128
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13Fix a typo in Rev docsStjepan Glavina-1/+1
2017-02-19Docs: Better explanation of return values for min, max functionsMikhail Pak-6/+22
Explain that a None is returned if the iterator is empty.
2017-02-17code order tweakking6cong-3/+3
2017-02-10iterator docs: Move paragraph about discarding; clarify "consumed"Rob Speer-5/+5
2017-02-10Rephrase my proposed edit ("objects" -> "elements")Rob Speer-1/+1
2017-02-10Fix a misleading statement in `Iterator.nth()`Rob Speer-1/+4
The `Iterator.nth()` documentation says "Note that all preceding elements will be consumed". I assumed from that that the preceding elements would be the *only* ones that were consumed, but in fact the returned element is consumed as well. The way I read the documentation, I assumed that `nth(0)` would not discard anything (as there are 0 preceding elements), so I added a sentence clarifying that it does. I also rephrased it to avoid the stunted "i.e." phrasing.
2017-02-05Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichtonCorey Farwell-7/+11
Fix a few impl stability attributes The versions show up in rustdoc.
2017-02-05Rollup merge of #39107 - llogiq:branchless_filter_count, r=alexcrichtonCorey Farwell-1/+21
branchless .filter(_).count() I found that the branchless version is only slower if we have little to no branch misses, which usually isn't the case. I notice speedups between -5% (perfect prediction) and 60% (real world data).
2017-02-04Auto merge of #39399 - clarcharr:iter_rfind, r=alexcrichtonbors-0/+58
Add Iterator::rfind. I found it weird that `Iterator` has `rpostition` but not `rfind`. This adds that method.
2017-02-03Bump version, upgrade bootstrapAlex Crichton-1/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-02-03Move rfind to DoubleEndedIterator, add tracking issue.Clar Charr-58/+58
2017-01-29Add Iterator::rfind.Clar Charr-0/+58
2017-01-29Fix a few impl stability attributesOliver Middleton-7/+11
The versions show up in rustdoc.
2017-01-27Fix a few links in the docsOliver Middleton-3/+3
2017-01-24add explanation, fix testAndre Bogus-0/+11
2017-01-17fix style nitsAndre Bogus-7/+6