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

Added Default trait for Cow. #34305

Merged
merged 1 commit into from
Jul 1, 2016
Merged

Added Default trait for Cow. #34305

merged 1 commit into from
Jul 1, 2016

Conversation

XAMPPRocky
Copy link
Member

Adds a default implementation for Cow. Which is the Owned's default.

@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 @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.

@alexcrichton
Copy link
Member

Thanks for the PR! Could you separate out the formatting changes from the Default addition? Doing so as a separate commit should be fine to do so as well.

cc @rust-lang/libs, any objections?

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jun 16, 2016
@@ -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,
Copy link
Member

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?

Copy link
Member Author

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.

@XAMPPRocky
Copy link
Member Author

@alexcrichton Sorry, left rustfmt on. Fixed it.

@brson
Copy link
Contributor

brson commented Jun 20, 2016

Seems consistent with our trend of adding more defaults. Please squash these commits though.

@XAMPPRocky
Copy link
Member Author

@brson Done.

@brson
Copy link
Contributor

brson commented Jun 22, 2016

Thanks @Aaronepower. Just waiting for the libs team to confer about it.

@aturon aturon added the I-needs-decision Issue: In need of a decision. label Jun 27, 2016
@alexcrichton alexcrichton removed the I-needs-decision Issue: In need of a decision. label Jun 28, 2016
@alexcrichton
Copy link
Member

Discussed during libs triage yesterday the conclusion was to merge, thanks for the PR @Aaronepower!

@bors: r+ 703d7b5

jseyfried added a commit to jseyfried/rust that referenced this pull request Jun 29, 2016
Added Default trait for Cow.

Adds a default implementation for Cow. Which is the Owned's default.
@bors
Copy link
Contributor

bors commented Jun 29, 2016

⌛ Testing commit 703d7b5 with merge 16d20c1...

bors added a commit that referenced this pull request Jun 29, 2016
Added Default trait for Cow.

Adds a default implementation for Cow. Which is the Owned's default.
@bors
Copy link
Contributor

bors commented Jun 29, 2016

💔 Test failed - auto-linux-64-x-android-t

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jun 29, 2016 at 2:17 AM, bors notifications@github.com wrote:

💔 Test failed - auto-linux-64-x-android-t
http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/9591


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34305 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAD95Le1sx2YRm4BSKzgYwWi_Ly50dngks5qQjgMgaJpZM4I3a0D
.

@bors
Copy link
Contributor

bors commented Jun 29, 2016

💣 Failed to start rebuilding: 301 Moved Permanently

@bors
Copy link
Contributor

bors commented Jun 29, 2016

⌛ Testing commit 703d7b5 with merge e3e222c...

@bors
Copy link
Contributor

bors commented Jun 29, 2016

💔 Test failed - auto-linux-cross-opt

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jun 29, 2016 at 1:17 PM, bors notifications@github.com wrote:

💔 Test failed - auto-linux-cross-opt
https://buildbot.rust-lang.org/builders/auto-linux-cross-opt/builds/2797


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34305 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAD95Kim_eonvEbegzk3f2XUfkR4i648ks5qQtK_gaJpZM4I3a0D
.

bors added a commit that referenced this pull request Jun 30, 2016
Rollup of 5 pull requests

 - Successful merges: #34105, #34305, #34512, ~~#34531,~~ #34547
@bors
Copy link
Contributor

bors commented Jul 1, 2016

☔ The latest upstream changes (presumably #34541) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors merged commit 703d7b5 into rust-lang:master Jul 1, 2016
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.

8 participants