This repository was archived by the owner on Nov 6, 2020. It is now read-only.
remove trait bounds from several structs#9055
Merged
andresilva merged 1 commit intomasterfrom Jul 9, 2018
Merged
Conversation
niklasad1
reviewed
Jul 6, 2018
| impl<T> Diff<T> { | ||
| /// Construct new object with given `pre` and `post`. | ||
| pub fn new(pre: T, post: T) -> Self { if pre == post { Diff::Same } else { Diff::Changed(pre, post) } } | ||
| pub fn new(pre: T, post: T) -> Self where T: Eq { |
Collaborator
There was a problem hiding this comment.
I'm not that familiar with derive rules for Eq, but looks a little strange that we have to specify Eq in the constructor (T: Eq) when we have specified it in the derive already!
Can somebody explain this? :)
Collaborator
Author
There was a problem hiding this comment.
derive(Debug) means
impl<T> Debug for Diff<T> where T: Debug {
// ...
}so it is a separate impl and has nothing to do with this one
Contributor
|
Needs a 2nd review. |
andresilva
approved these changes
Jul 9, 2018
ordian
added a commit
to ordian/parity
that referenced
this pull request
Jul 9, 2018
…rp_sync_on_light_client * 'master' of https://github.com/paritytech/parity: remove trait bounds from several structs (openethereum#9055)
dvdplm
added a commit
that referenced
this pull request
Jul 10, 2018
* master: Clean up deprecated options and add CHECK macro (#9036) Replace `std::env::home_dir` with `dirs::home_dir` (#9077) fix warning in secret-store test (#9074) SeedHashCompute remove needless `new` impl (#9063) remove trait bounds from several structs (#9055) docs: add changelog for 1.10.9 stable and 1.11.6 beta (#9069) Enable test in `miner/pool/test` (#9072)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
as described here: https://rust-lang-nursery.github.io/api-guidelines/future-proofing.html#c-struct-bounds