-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
std: Changing the meaning of the count to splitn #23951
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon |
Can you add documentation saying that the last element returned, if any, contains the remainder of the data? Otherwise r=me |
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: rust-lang/rfcs#979 Closes rust-lang#23911 [breaking-change]
@bors: r=aturon e98dce3 |
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: rust-lang/rfcs#979 Closes rust-lang#23911 [breaking-change]
Uh. I wish this had also included a change that breaks at compile time, like renaming the function or something. As it is, it seems likely to cause silent breakage. |
Yep, this siliently bit me. Thankfully I had tests, but it was quite confusing. |
@SimonSapin @seanmonstar Yes, this was an unfortunate rush, and I apologize for the inconvenience. |
This commit is an implementation of RFC 979 which changes the meaning of
the count parameter to the
splitn
function on strings and slices. Theparameter now means the number of items that are returned from the iterator, not
the number of splits that are made.
Closes #23911
[breaking-change]