Unconditionally implement Eq for Handle

This commit is contained in:
Hanno Braun 2025-02-10 20:16:14 +01:00
parent 32f2e92d64
commit 2f409a8b15

View File

@ -29,7 +29,7 @@ impl fmt::Display for OperationDisplay<'_> {
}
}
#[derive(Eq, Ord, PartialEq, PartialOrd)]
#[derive(Ord, PartialOrd)]
pub struct Handle<T> {
inner: Rc<T>,
}
@ -72,6 +72,14 @@ impl<T> Deref for Handle<T> {
}
}
impl<T> Eq for Handle<T> {}
impl<T> PartialEq for Handle<T> {
fn eq(&self, other: &Self) -> bool {
Rc::ptr_eq(&self.inner, &other.inner)
}
}
impl<T> fmt::Debug for Handle<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Handle")