mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
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:
committed by
Johannes Altmanninger
parent
ec77c34ebe
commit
831411ddd5
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user