use serde::{Deserialize, Serialize};
use std::{
    cmp::Ordering,
    hash::{Hash, Hasher},
};

#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
pub struct IgnoreForEquality<T>(pub T);

impl<T> PartialEq for IgnoreForEquality<T> {
    fn eq(&self, _other: &Self) -> bool {
        true
    }
}
impl<T> Eq for IgnoreForEquality<T> {}

impl<T> PartialOrd for IgnoreForEquality<T> {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}
impl<T> Ord for IgnoreForEquality<T> {
    fn cmp(&self, _other: &Self) -> Ordering {
        Ordering::Equal
    }
}

impl<T> Hash for IgnoreForEquality<T> {
    fn hash<H: Hasher>(&self, _: &mut H) {}
}
