use std::cmp::Ordering;
#[allow(clippy::derived_hash_with_manual_eq)]
#[derive(Debug, Clone, Copy, Hash)]
pub struct SpectaID {
pub(crate) type_name: &'static str,
pub(crate) hash: u64,
}
impl Ord for SpectaID {
fn cmp(&self, other: &Self) -> Ordering {
self.type_name
.cmp(other.type_name)
.then(self.hash.cmp(&other.hash))
}
}
impl PartialOrd<Self> for SpectaID {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Eq for SpectaID {}
impl PartialEq<Self> for SpectaID {
fn eq(&self, other: &Self) -> bool {
self.hash.eq(&other.hash)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct ImplLocation(pub(crate) &'static str);
impl ImplLocation {
pub const fn as_str(&self) -> &'static str {
self.0
}
}