This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
remove trait bounds from several structs #9055
Merged
Merged
Conversation
This file contains 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
niklasad1
approved these changes
Jul 6, 2018
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.
Looks good to me
niklasad1
reviewed
Jul 6, 2018
/// 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 { |
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.
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? :)
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.
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
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)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A2-insubstantial 👶
Pull request requires no code review (e.g., a sub-repository hash update).
A8-looksgood 🦄
Pull request is reviewed well.
M4-core ⛓
Core client code / Rust.
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