-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Test and fix size_hint
for slice’s [r]split* iterators
#87974
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
Conversation
389953b
to
8d1d63e
Compare
Adds extensive test for all the [r]split* iterators. Fixes size_hint upper bound for split_inclusive* iterators which was one higher than necessary for non-empty slices. Fixes size_hint lower bound for [r]splitn* iterators when n==0, which was one too high.
8d1d63e
to
31e49f0
Compare
@rustbot label T-libs, A-iterators, A-slice |
@rust-highfive failed. I’m choosing at random from this list. r? @dtolnay |
a467715
to
8cb1cec
Compare
This comment has been minimized.
This comment has been minimized.
Ah, the damn tidy check -.- By the way (note for review:) I was only force-pushing to amend the new commit. |
8cb1cec
to
0bb11f4
Compare
This comment has been minimized.
This comment has been minimized.
67ac748
to
3f0d04e
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.
Thanks!
@bors r+ |
📌 Commit 3f0d04e has been approved by |
☀️ Test successful - checks-actions |
Adds extensive test (of
size_hint
) for all the [r]split* iterators.Fixes
size_hint
upper bound for split_inclusive* iterators which was one higher than necessary for non-empty slices.Fixes
size_hint
lower bound for [r]splitn* iterators when n == 0, which was one too high.Lower bound being one too high was a logic error, violating the correctness condition of
size_hint
.Edit: I’ve opened an issue for that bug, so this PR fixes #87978