mirror of
https://github.com/hannobraun/Fornjot
synced 2025-08-13 12:46:06 +00:00
Unconditionally implement Eq
for Handle
This commit is contained in:
parent
32f2e92d64
commit
2f409a8b15
@ -29,7 +29,7 @@ impl fmt::Display for OperationDisplay<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, Ord, PartialEq, PartialOrd)]
|
#[derive(Ord, PartialOrd)]
|
||||||
pub struct Handle<T> {
|
pub struct Handle<T> {
|
||||||
inner: Rc<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> {
|
impl<T> fmt::Debug for Handle<T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.debug_struct("Handle")
|
f.debug_struct("Handle")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user