Skip to content

Commit 4a86156

Browse files
author
Michael Wright
committed
Simplify FullInt Ord impl (2)
1 parent c6dca68 commit 4a86156

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clippy_utils/src/consts.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,13 @@ impl PartialOrd for FullInt {
253253
impl Ord for FullInt {
254254
#[must_use]
255255
fn cmp(&self, other: &Self) -> Ordering {
256+
use FullInt::{S, U};
257+
256258
match (*self, *other) {
257-
(Self::S(s), Self::S(o)) => s.cmp(&o),
258-
(Self::U(s), Self::U(o)) => s.cmp(&o),
259-
(Self::S(s), Self::U(o)) => Self::cmp_s_u(s, o),
260-
(Self::U(s), Self::S(o)) => Self::cmp_s_u(o, s).reverse(),
259+
(S(s), S(o)) => s.cmp(&o),
260+
(U(s), U(o)) => s.cmp(&o),
261+
(S(s), U(o)) => Self::cmp_s_u(s, o),
262+
(U(s), S(o)) => Self::cmp_s_u(o, s).reverse(),
261263
}
262264
}
263265
}

0 commit comments

Comments
 (0)