std: Changing the meaning of the count to splitn#23951
Merged
alexcrichton merged 1 commit intorust-lang:masterfrom Apr 2, 2015
Merged
std: Changing the meaning of the count to splitn#23951alexcrichton merged 1 commit intorust-lang:masterfrom
alexcrichton merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
r? @aturon |
Contributor
|
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]
Member
Author
|
@bors: r=aturon e98dce3 |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Apr 1, 2015
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]
Contributor
|
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. |
Contributor
|
Yep, this siliently bit me. Thankfully I had tests, but it was quite confusing. |
Contributor
|
@SimonSapin @seanmonstar Yes, this was an unfortunate rush, and I apologize for the inconvenience. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is an implementation of RFC 979 which changes the meaning of
the count parameter to the
splitnfunction 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]