We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f14fd62 commit a8d1194Copy full SHA for a8d1194
src/utils/serial.rs
@@ -22,11 +22,7 @@ impl Eq for Serial {}
22
impl PartialOrd for Serial {
23
#[inline]
24
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
25
- let distance = if self.0 > other.0 {
26
- self.0 - other.0
27
- } else {
28
- other.0 - self.0
29
- };
+ let distance = self.0.abs_diff(other.0);
30
if distance < u32::MAX / 2 {
31
self.0.partial_cmp(&other.0)
32
} else {
0 commit comments