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

Add `FromIterator` implementations for `Cow<str>` #35064

Merged
merged 1 commit into from Aug 9, 2016

Conversation

@pthariensflame
Copy link
Contributor

pthariensflame commented Jul 27, 2016

This seems like an oversight, since the corresponding implementation for Cow<[T]> where T: Clone exists.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jul 27, 2016

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rphmeier

This comment has been minimized.

Copy link
Contributor

rphmeier commented Jul 27, 2016

Would be nice to have an impl<'a, T: 'a, U> FromIterator<U> for Cow<'a, T> where T: ToOwned, T::Owned: FromIterator<U>

but I guess the ship has sailed on that already

@alexcrichton alexcrichton added the T-libs label Jul 27, 2016
@pthariensflame

This comment has been minimized.

Copy link
Contributor Author

pthariensflame commented Jul 27, 2016

@rphmeier Wouldn't that be a strict generalization of every current FromIterator impl for Cow? If everyone wants me to, I could do that instead, and just replace the existing impls with the new unified one.

@pthariensflame pthariensflame force-pushed the pthariensflame:feature/cow_str_from_iter branch 5 times, most recently from ab328e5 to 61ff591 Jul 30, 2016
@@ -274,3 +274,13 @@ impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
self
}
}

// // Generic implementation mentioned in

This comment has been minimized.

Copy link
@sfackler

sfackler Aug 5, 2016

Member

Could we get rid of this dead code?

This comment has been minimized.

Copy link
@pthariensflame

pthariensflame Aug 5, 2016

Author Contributor

I had included it because of @rphmeier's earlier comment, but I can remove it again.

@sfackler

This comment has been minimized.

Copy link
Member

sfackler commented Aug 5, 2016

Could you remove the commented out implementation and squash down to one commit? We should be good to merge once that happens.

@pthariensflame pthariensflame force-pushed the pthariensflame:feature/cow_str_from_iter branch from 61ff591 to 010e024 Aug 5, 2016
@pthariensflame

This comment has been minimized.

Copy link
Contributor Author

pthariensflame commented Aug 5, 2016

@sfackler Done!

@pthariensflame pthariensflame force-pushed the pthariensflame:feature/cow_str_from_iter branch from 010e024 to 31d968c Aug 5, 2016
@pthariensflame

This comment has been minimized.

Copy link
Contributor Author

pthariensflame commented Aug 7, 2016

@sfackler Any word?

This seems like an oversight, since the corresponding implementation for `Cow<[T]> where T: Clone` exists.
@pthariensflame pthariensflame force-pushed the pthariensflame:feature/cow_str_from_iter branch from 31d968c to 42e64bc Aug 7, 2016
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 8, 2016

Discussed at libs traige this this past week the decision was to merge, thanks for the PR @pthariensflame!

@bors: r+ 42e64bc

@pthariensflame

This comment has been minimized.

Copy link
Contributor Author

pthariensflame commented Aug 8, 2016

@alexcrichton Thanks!

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 8, 2016

⌛️ Testing commit 42e64bc with merge 080e0e0...

bors added a commit that referenced this pull request Aug 8, 2016
…excrichton

Add `FromIterator` implementations for `Cow<str>`

This seems like an oversight, since the corresponding implementation for `Cow<[T]> where T: Clone` exists.
@bors bors merged commit 42e64bc into rust-lang:master Aug 9, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@pthariensflame pthariensflame deleted the pthariensflame:feature/cow_str_from_iter branch Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.