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

Extend<&str> and FromIterator<&str> for String #19626

Merged
merged 4 commits into from
Dec 9, 2014

Conversation

bluss
Copy link
Member

@bluss bluss commented Dec 7, 2014

Strings iterate to both char and &str, so it is natural it can also be extended or collected from an iterator of &str.

Apart from the trait implementations, Extend<char> is updated to use the iterator size hint, and the test added tests both the char and the &str versions of Extend and FromIterator.

bluss added 2 commits December 7, 2014 21:31
&str is a "particle" of a string already, see the graphemes iterator,
so it seems natural that we should be able to use it with Extend.
@bluss bluss force-pushed the string-extend-str branch 2 times, most recently from fe83d98 to 976c658 Compare December 7, 2014 21:47
@bluss bluss force-pushed the string-extend-str branch from 976c658 to a813469 Compare December 7, 2014 22:13
@bluss
Copy link
Member Author

bluss commented Dec 7, 2014

This will need an RFC.

@aturon aturon added the A-libs label Dec 7, 2014
@aturon
Copy link
Member

aturon commented Dec 7, 2014

cc @gankro

@sinistersnare
Copy link
Contributor

I do not think this needs an RFC. the RFCs repo states that an RFC is for a substantial change and I do not think this change requires one. @aturon thoughts on this?

@aturon
Copy link
Member

aturon commented Dec 7, 2014

Yeah, this is quite minor and we could accept a PR for it without an RFC.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 9, 2014
Strings iterate to both char and &str, so it is natural it can also be extended or collected from an iterator of &str.

Apart from the trait implementations, `Extend<char>` is updated to use the iterator size hint, and the test added tests both the char and the &str versions of Extend and FromIterator.
@bors bors merged commit a813469 into rust-lang:master Dec 9, 2014
@bluss bluss deleted the string-extend-str branch December 9, 2014 22:05
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.

5 participants