Browse Source

make EventHandler partialeq

Evan Almloff 1 năm trước cách đây
mục cha
commit
ebacc7b709
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      packages/core/src/events.rs

+ 6 - 0
packages/core/src/events.rs

@@ -168,6 +168,12 @@ impl<T> Clone for EventHandler<T> {
     }
     }
 }
 }
 
 
+impl<T> PartialEq for EventHandler<T> {
+    fn eq(&self, other: &Self) -> bool {
+        Rc::ptr_eq(&self.callback, &other.callback)
+    }
+}
+
 impl<T> Default for EventHandler<T> {
 impl<T> Default for EventHandler<T> {
     fn default() -> Self {
     fn default() -> Self {
         Self {
         Self {