diff options
| author | Michael Wright <mikerite@lavabit.com> | 2021-10-30 06:22:19 +0200 |
|---|---|---|
| committer | Michael Wright <mikerite@lavabit.com> | 2021-10-30 06:22:19 +0200 |
| commit | 4a86156c66a8cb66da85ffe68b90bd0f643e441b (patch) | |
| tree | 1d98f24a7df8a04879ae09febd578a1197f6f05b | |
| parent | c6dca68eca75a46af31d7175486909c720c2aebc (diff) | |
| download | rust-4a86156c66a8cb66da85ffe68b90bd0f643e441b.tar.gz rust-4a86156c66a8cb66da85ffe68b90bd0f643e441b.zip | |
Simplify FullInt Ord impl (2)
| -rw-r--r-- | clippy_utils/src/consts.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clippy_utils/src/consts.rs b/clippy_utils/src/consts.rs index 7ce9676ed05..e40a1d2f279 100644 --- a/clippy_utils/src/consts.rs +++ b/clippy_utils/src/consts.rs @@ -253,11 +253,13 @@ impl PartialOrd for FullInt { impl Ord for FullInt { #[must_use] fn cmp(&self, other: &Self) -> Ordering { + use FullInt::{S, U}; + match (*self, *other) { - (Self::S(s), Self::S(o)) => s.cmp(&o), - (Self::U(s), Self::U(o)) => s.cmp(&o), - (Self::S(s), Self::U(o)) => Self::cmp_s_u(s, o), - (Self::U(s), Self::S(o)) => Self::cmp_s_u(o, s).reverse(), + (S(s), S(o)) => s.cmp(&o), + (U(s), U(o)) => s.cmp(&o), + (S(s), U(o)) => Self::cmp_s_u(s, o), + (U(s), S(o)) => Self::cmp_s_u(o, s).reverse(), } } } |
