fix: clippy::ref_as_ptr

https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr

Part of #12136
This commit is contained in:
xtqqczze
2025-12-10 20:58:00 +00:00
committed by Johannes Altmanninger
parent ec77c34ebe
commit 831411ddd5
7 changed files with 12 additions and 14 deletions

View File

@@ -494,11 +494,11 @@ pub fn new() -> Self {
}
pub fn remove(&mut self, element: &dyn IoData) {
// Discard vtable pointers when comparing.
let e1 = element as *const dyn IoData as *const ();
let e1 = std::ptr::from_ref(element) as *const ();
let idx = self
.0
.iter()
.position(|e2| Arc::as_ref(e2) as *const dyn IoData as *const () == e1)
.position(|e2| Arc::as_ptr(e2) as *const () == e1)
.expect("Element not found");
self.0.remove(idx);
}