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

alexcrichton
Copy link
Member

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
Copy link
Collaborator

r? @pcwalton

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

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned pcwalton Apr 1, 2015
@aturon
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

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
Copy link
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]
@alexcrichton alexcrichton merged commit e98dce3 into rust-lang:master Apr 2, 2015
@alexcrichton alexcrichton deleted the splitn branch April 2, 2015 01:43
@SimonSapin
Copy link
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.

@seanmonstar
Copy link
Contributor

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

@aturon
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for "Align the count parameter of splitn with other languages" (RFC 979)
6 participants