mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
clippy: Fix vtable_address_comparisons error (#32262)
* 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>
This commit is contained in:
parent
16803bc0f8
commit
aaf3d1bfd9
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue