fix subscriptions in events

This commit is contained in:
Evan Almloff committed 2023-08-04 17:23:57 -07:00
1 parent 07ed3e67dd
commit a6f611eccf
12 files changed
+445 -103

No files matched your search

+1 -1
View File
@@ -14,4 +14,4 @@ rand = "0.8.5"
[features]
default = ["check_generation"]
check_generation = []
check_generation = []
+11
View File
@@ -193,6 +193,17 @@ impl<T: 'static> CopyHandle<T> {
pub fn write(&self) -> RefMut<'_, T> {
self.try_write().unwrap()
}
pub fn ptr_eq(&self, other: &Self) -> bool {
#[cfg(any(debug_assertions, feature = "check_generation"))]
{
self.raw.data.as_ptr() == other.raw.data.as_ptr() && self.generation == other.generation
}
#[cfg(not(any(debug_assertions, feature = "check_generation")))]
{
self.raw.data.as_ptr() == other.raw.data.as_ptr()
}
}
}
impl<T> Copy for CopyHandle<T> {}