1 #![warn(clippy::absurd_extreme_comparisons)]
6 clippy::unnecessary_operation,
7 clippy::needless_pass_by_value
34 // this is handled by clippy::unit_cmp
38 use std::cmp::{Ordering, PartialEq, PartialOrd};
40 #[derive(PartialEq, PartialOrd)]
43 impl PartialEq<u32> for U {
44 fn eq(&self, other: &u32) -> bool {
45 self.eq(&U(u64::from(*other)))
48 impl PartialOrd<u32> for U {
49 fn partial_cmp(&self, other: &u32) -> Option<Ordering> {
50 self.partial_cmp(&U(u64::from(*other)))
54 pub fn foo(val: U) -> bool {
58 pub fn bar(len: u64) -> bool {
59 // This is OK as we are casting from target sized to fixed size
60 len >= usize::MAX as u64