Skip to content

Commit

Permalink
clippy: Fix vtable_address_comparisons error (#32262)
Browse files Browse the repository at this point in the history
* clippy: Fix vtable_address_comparisons error

* Update components/script/dom/bindings/root.rs

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>

---------

Co-authored-by: Sergii Tomusiak <sergiitomusiak@github.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
  • Loading branch information
3 people committed May 9, 2024
1 parent 16803bc commit aaf3d1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/script/dom/bindings/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ impl RootCollection {
unsafe fn unroot(&self, object: *const dyn JSTraceable) {
assert_in_script();
let roots = &mut *self.roots.get();
match roots.iter().rposition(|r| std::ptr::eq(*r, object)) {
// FIXME: Use std::ptr::addr_eq after migrating to newer version of std.
match roots
.iter()
.rposition(|r| std::ptr::eq(*r as *const (), object as *const ()))
{
Some(idx) => {
roots.remove(idx);
},
Expand Down

0 comments on commit aaf3d1b

Please sign in to comment.