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

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

@rust-highfive
Copy link
Collaborator

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

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-api Relevant to the library API team, which will review and decide on the PR/issue. label Jul 27, 2016
@pthariensflame
Copy link
Contributor Author

@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 feature/cow_str_from_iter branch 5 times, most recently from ab328e5 to 61ff591 Compare August 4, 2016 23:16
@@ -274,3 +274,13 @@ impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
self
}
}

// // Generic implementation mentioned in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get rid of this dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sfackler
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
Copy link
Contributor Author

@sfackler Done!

@pthariensflame
Copy link
Contributor Author

@sfackler Any word?

This seems like an oversight, since the corresponding implementation for `Cow<[T]> where T: Clone` exists.
@alexcrichton
Copy link
Member

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

@bors: r+ 42e64bc

@pthariensflame
Copy link
Contributor Author

@alexcrichton Thanks!

@bors
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
@pthariensflame pthariensflame deleted the feature/cow_str_from_iter branch August 9, 2016 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants