-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Added Default trait for Cow. #34305
Added Default trait for Cow. #34305
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gankro (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. |
Thanks for the PR! Could you separate out the formatting changes from the cc @rust-lang/libs, any objections? |
@@ -248,8 +261,20 @@ impl<'a, B: ?Sized> fmt::Display for Cow<'a, B> | |||
} | |||
} | |||
|
|||
#[stable(feature = "default", since = "1.11.0")] | |||
impl<'a, B: ?Sized> Default for Cow<'a, B> | |||
where B: Default + ToOwned, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does B
really need to implement Default
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess it doesn't only it's Owned version does.
@alexcrichton Sorry, left rustfmt on. Fixed it. |
Seems consistent with our trend of adding more defaults. Please squash these commits though. |
@brson Done. |
Thanks @Aaronepower. Just waiting for the libs team to confer about it. |
Discussed during libs triage yesterday the conclusion was to merge, thanks for the PR @Aaronepower! |
Added Default trait for Cow. Adds a default implementation for Cow. Which is the Owned's default.
Added Default trait for Cow. Adds a default implementation for Cow. Which is the Owned's default.
💔 Test failed - auto-linux-64-x-android-t |
@bors: retry On Wed, Jun 29, 2016 at 2:17 AM, bors [email protected] wrote:
|
💣 Failed to start rebuilding: |
⌛ Testing commit 703d7b5 with merge e3e222c... |
💔 Test failed - auto-linux-cross-opt |
@bors: retry On Wed, Jun 29, 2016 at 1:17 PM, bors [email protected] wrote:
|
☔ The latest upstream changes (presumably #34541) made this pull request unmergeable. Please resolve the merge conflicts. |
Adds a default implementation for Cow. Which is the Owned's default.