Skip to content
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

Merged
merged 1 commit into from Apr 2, 2015

Conversation

Projects
None yet
6 participants
@alexcrichton
Copy link
Member

alexcrichton commented Apr 1, 2015

This commit is an implementation of RFC 979 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.

Closes #23911
[breaking-change]

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Apr 1, 2015

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 1, 2015

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned pcwalton Apr 1, 2015

@aturon

This comment has been minimized.

Copy link
Member

aturon commented Apr 1, 2015

Can you add documentation saying that the last element returned, if any, contains the remainder of the data?

Otherwise r=me

std: Changing the meaning of the count to splitn
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 #23911
[breaking-change]

@alexcrichton alexcrichton force-pushed the alexcrichton:splitn branch from cf435e4 to e98dce3 Apr 1, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 1, 2015

@bors: r=aturon e98dce3

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 1, 2015

rollup merge of rust-lang#23951: alexcrichton/splitn
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]

@alexcrichton alexcrichton merged commit e98dce3 into rust-lang:master Apr 2, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@alexcrichton alexcrichton deleted the alexcrichton:splitn branch Apr 2, 2015

@SimonSapin

This comment has been minimized.

Copy link
Contributor

SimonSapin commented Apr 2, 2015

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.

@seanmonstar

This comment has been minimized.

Copy link
Contributor

seanmonstar commented Apr 2, 2015

Yep, this siliently bit me. Thankfully I had tests, but it was quite confusing.

@aturon

This comment has been minimized.

Copy link
Member

aturon commented Apr 2, 2015

@SimonSapin @seanmonstar Yes, this was an unfortunate rush, and I apologize for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.