Skip to content

Commit 2f409a8

Browse files
committed
Unconditionally implement Eq for Handle
1 parent 32f2e92 commit 2f409a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

experiments/2024-12-09/src/geometry/operation.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl fmt::Display for OperationDisplay<'_> {
2929
}
3030
}
3131

32-
#[derive(Eq, Ord, PartialEq, PartialOrd)]
32+
#[derive(Ord, PartialOrd)]
3333
pub struct Handle<T> {
3434
inner: Rc<T>,
3535
}
@@ -72,6 +72,14 @@ impl<T> Deref for Handle<T> {
7272
}
7373
}
7474

75+
impl<T> Eq for Handle<T> {}
76+
77+
impl<T> PartialEq for Handle<T> {
78+
fn eq(&self, other: &Self) -> bool {
79+
Rc::ptr_eq(&self.inner, &other.inner)
80+
}
81+
}
82+
7583
impl<T> fmt::Debug for Handle<T> {
7684
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7785
f.debug_struct("Handle")

0 commit comments

Comments
 (0)