From dbc8fc9459bff6ae5420740166dd96388f1e28a5 Mon Sep 17 00:00:00 2001 From: shuimuliang Date: Sat, 7 Oct 2023 00:37:14 +0800 Subject: [PATCH] build: toolchain update to 1.73.0 --- .github/workflows/rust.yml | 2 +- anychain-ripple/src/transaction.rs | 20 ++++++++++---------- rust-toolchain.toml | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b7cb743..771ec91 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - rust-version: [1.72.1] + rust-version: [1.73.0] steps: - name: Checkout code diff --git a/anychain-ripple/src/transaction.rs b/anychain-ripple/src/transaction.rs index 56aaf1e..08592b6 100644 --- a/anychain-ripple/src/transaction.rs +++ b/anychain-ripple/src/transaction.rs @@ -489,30 +489,30 @@ impl PartialEq for SerializedType { } } -impl PartialOrd for SerializedType { - fn partial_cmp(&self, other: &Self) -> Option { +impl Ord for SerializedType { + fn cmp(&self, other: &Self) -> Ordering { let typ0 = self.typ() as u32; let val0 = self.val(); let typ1 = other.typ() as u32; let val1 = other.val(); if typ0 < typ1 { - Some(Ordering::Less) + Ordering::Less } else if typ0 > typ1 { - Some(Ordering::Greater) + Ordering::Greater } else if val0 < val1 { - Some(Ordering::Less) + Ordering::Less } else if val0 > val1 { - Some(Ordering::Greater) + Ordering::Greater } else { - Some(Ordering::Equal) + Ordering::Equal } } } -impl Ord for SerializedType { - fn cmp(&self, other: &Self) -> Ordering { - self.partial_cmp(other).unwrap() +impl PartialOrd for SerializedType { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ad0f092..30b679b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.72.1" +channel = "1.73.0" components = ["clippy", "rustfmt"] targets = [] profile = "minimal"