competitive/tools/
partial_ignored_ord.rs

1#[derive(Debug, Default, Clone, Copy)]
2pub struct PartialIgnoredOrd<T, U>(pub T, pub U);
3impl<T: Eq, U> Eq for PartialIgnoredOrd<T, U> {}
4impl<T, U> PartialEq for PartialIgnoredOrd<T, U>
5where
6    T: PartialEq,
7{
8    fn eq(&self, other: &Self) -> bool {
9        self.0.eq(&other.0)
10    }
11}
12impl<T, U> PartialOrd for PartialIgnoredOrd<T, U>
13where
14    T: PartialOrd,
15{
16    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
17        self.0.partial_cmp(&other.0)
18    }
19}
20impl<T, U> Ord for PartialIgnoredOrd<T, U>
21where
22    T: Ord,
23{
24    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
25        self.0.cmp(&other.0)
26    }
27}