-
Notifications
You must be signed in to change notification settings - Fork 254
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
subxt: Derive std::cmp
traits for subxt payloads and addresses
#1429
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
98c9ab7
subxt/tx: Derive std::cmp traits
lexnv 271e881
subxt/runtime_api: Derive std::cmp traits
lexnv db2fac3
subxt/constants: Derive std::cmp traits
lexnv 329bab9
subxt/custom_values: Derive std::cmp traits
lexnv 890c051
subxt/storage: Derive std::cmp traits
lexnv eed11c5
subxt: Fix non_canonical_partial_ord_impl clippy introduced in 1.73
lexnv e4b5959
subxt: Add comment wrt derivative issue that triggers clippy warning
lexnv 3699a90
Update subxt/src/backend/mod.rs
niklasad1 72ea9be
Update subxt/src/constants/constant_address.rs
niklasad1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
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 this generate:
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.
It does seem to generate that for the
Eq
(using cargo expand)impl<ArgsData, ReturnTy> ::std::cmp::Eq for Payload<ArgsData, ReturnTy> where ArgsData: std::cmp::Eq {}
.However, for the others it does match the fields 🤔
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.
What do you mean here? I'd be curious to see the generated output :)
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.
This is from the address of the constants:
I wanted to say that it generates the expected output. I guess I was a bit confused by the
impl<T: PartialEq> for Payload<..> {}
, which should have anfn eq(..)
but after reading it again, I think Niklas was asking more about the boundsThere 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.
^ that's a different type from where this comment is which confused me for a bit; the expanded output for this one should have the bounds like
<ArgsData: std::cmp::partialEq>
etc :)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.
Oops, yep this is the
PartialEq
for this: