-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .get(range)
#891
Add .get(range)
#891
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #891 +/- ##
==========================================
+ Coverage 94.38% 94.57% +0.18%
==========================================
Files 48 49 +1
Lines 6665 7002 +337
==========================================
+ Hits 6291 6622 +331
- Misses 374 380 +6 ☔ View full report in Codecov by Sentry. |
97c74c3
to
d518cae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these are just things to ponder that might not need changing, but I think at least the overflow thing should be tweaked.
8831e7d
to
b891b69
Compare
I rebased on master and added 4 commits:
And removed |
6477ac0
to
de08253
Compare
Co-Authored-By: wod3 <[email protected]>
Co-Authored-By: TrolledWoods <[email protected]>
Fix my own review. Update docs. Fix a warning with `#[cfg(doc)]`. Use public path `traits::IteratorIndex` instead of private path `iter_index::IteratorIndex`.
As we should, I checked it can't pass without `let _ =`.
`RangeInclusive::is_empty` (rust 1.47+) is in conflict with our MSRV (1.43.1) so we can't use it yet. The unspecified behavior is documented in `Itertools::get` so we simply remove this.
Unless there is a reason to prefer `Take<Skip>` over `Skip<Take>`?!
de08253
to
5e151ec
Compare
Test for coverage
A `use itertools::*;` might conflict with such a general function name.
5e151ec
to
3f49188
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tremendous thanks for getting this over the finish line! This looks fantastic.
Closes #447.
So much changes happened since this work was initiated that rebase on top of master seems nothing less than a nightmare to me (I know, I tried). I therefore looked at the git differences, committed those (after formatting) and credited @wod3 and @TrolledWoods for their respective commits. Then I fixed my own review and a bit more.
I thought I would additionally implement
IteratorIndex
forEither<range, range>
(andBox<dyn range>
but I could not) but doing so would later result in a nasty breaking change if this was removed after an eventual inclusion toIterator
.Details about either