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

subxt: Derive std::cmp traits for subxt payloads and addresses #1429

Merged
merged 9 commits into from
Feb 13, 2024
1 change: 1 addition & 0 deletions subxt/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl<H: PartialEq> PartialEq for BlockRef<H> {
}
impl<H: Eq> Eq for BlockRef<H> {}

// Manual implementation to work aroud https://github.com/mcarton/rust-derivative/issues/115.
niklasad1 marked this conversation as resolved.
Show resolved Hide resolved
impl<H: PartialOrd> PartialOrd for BlockRef<H> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.hash.partial_cmp(&other.hash)
Expand Down
1 change: 1 addition & 0 deletions subxt/src/constants/constant_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct Address<ReturnTy> {
_marker: std::marker::PhantomData<ReturnTy>,
}

// Manual implementation to work aroud https://github.com/mcarton/rust-derivative/issues/115.
niklasad1 marked this conversation as resolved.
Show resolved Hide resolved
impl<ReturnTy> PartialOrd for Address<ReturnTy> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
Expand Down
Loading