fix tooltips not disappearing, clippy

This commit is contained in:
Aleksander
2025-11-26 22:01:19 +01:00
parent d5c5d06b3a
commit 85eab33c94
10 changed files with 131 additions and 74 deletions
+20 -1
View File
@@ -1,4 +1,5 @@
use std::rc::Rc;
use std::hash::Hash;
use std::{hash::Hasher, rc::Rc};
use crate::{
any::AnyTrait,
@@ -54,3 +55,21 @@ impl Component {
unsafe { Ok(Rc::from_raw(Rc::into_raw(self.0.clone()).cast())) }
}
}
// these hash/eq impls are required in case we want to do something like HashSet<Component> for convenience reasons.
// hash by address
impl Hash for Component {
fn hash<H: Hasher>(&self, state: &mut H) {
std::ptr::hash(&raw const self.0, state);
}
}
// match by address
impl PartialEq for Component {
fn eq(&self, other: &Self) -> bool {
std::ptr::eq(&raw const self.0, &raw const other.0)
}
}
impl Eq for Component {}