diff --git a/src/log_parser.rs b/src/log_parser.rs index e0c439c..9d0129f 100644 --- a/src/log_parser.rs +++ b/src/log_parser.rs @@ -107,13 +107,13 @@ impl From<&LogLevel> for u32 { impl PartialOrd for LogLevel { fn partial_cmp(&self, other: &Self) -> Option { - Some(u32::from(self).cmp(&other.into())) + Some(self.cmp(other)) } } impl Ord for LogLevel { fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.partial_cmp(other).unwrap() + u32::from(self).cmp(&other.into()) } } diff --git a/src/xr_devices.rs b/src/xr_devices.rs index 846759f..45ccb9d 100644 --- a/src/xr_devices.rs +++ b/src/xr_devices.rs @@ -207,13 +207,13 @@ impl From<&XRDeviceRole> for u32 { impl PartialOrd for XRDeviceRole { fn partial_cmp(&self, other: &Self) -> Option { - Some(u32::from(self).cmp(&other.into())) + Some(self.cmp(other)) } } impl Ord for XRDeviceRole { fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.partial_cmp(other).unwrap() + u32::from(self).cmp(&other.into()) } }