clippy: Fix many warnings in components/script (#31717)

* Fix Several clippy warnings

* Fix Build errors

* Fix Unused import

* Fix requested changes

* Fix rustfmt

* Minor fixes

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Richard Dushime 2024-03-19 19:05:56 +03:00 committed by GitHub
parent 676f655647
commit 01ca220f83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 200 additions and 212 deletions

View file

@ -263,7 +263,7 @@ impl WindowProxy {
SetProxyReservedSlot(
js_proxy.get(),
0,
&PrivateValue((&*window_proxy).as_void_ptr()),
&PrivateValue((*window_proxy).as_void_ptr()),
);
// Notify the JS engine about the new window proxy binding.
@ -459,7 +459,7 @@ impl WindowProxy {
}
rooted!(in(cx) let mut val = UndefinedValue());
unsafe { opener_proxy.to_jsval(cx, val.handle_mut()) };
return val.get();
val.get()
}
// https://html.spec.whatwg.org/multipage/#window-open-steps
@ -1036,7 +1036,7 @@ unsafe extern "C" fn get_prototype_if_ordinary(
// non-wrapper object *must* report non-ordinary, even if static [[Prototype]]
// usually means ordinary.
*is_ordinary = false;
return true;
true
}
static PROXY_HANDLER: ProxyTraps = ProxyTraps {