clippy: Fix explicit_auto_deref warnings in components/script (#31837)

* clippy: Fix explicit auto-deref warnings

* clippy: Fix explicit auto-deref warnings

* refactor: Tidy up code

* refactor: Fix method not found errors
This commit is contained in:
Oluwatobi Sofela 2024-03-23 12:29:20 +01:00 committed by GitHub
parent 3fc157338e
commit 3c05b58221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 157 additions and 168 deletions

View file

@ -156,12 +156,12 @@ unsafe fn html_constructor(
// Any prototype used to create these elements will be overwritten before returning
// from this function, so we don't bother overwriting the defaults here.
let element = if definition.is_autonomous() {
DomRoot::upcast(HTMLElement::new(name.local, None, &*document, None))
DomRoot::upcast(HTMLElement::new(name.local, None, &document, None))
} else {
create_native_html_element(
name,
None,
&*document,
&document,
ElementCreator::ScriptCreated,
None,
)
@ -176,7 +176,7 @@ unsafe fn html_constructor(
element.set_custom_element_definition(definition.clone());
// Step 8.5
if !check_type(&*element) {
if !check_type(&element) {
throw_dom_exception(cx, global, Error::InvalidState);
return Err(());
} else {
@ -193,7 +193,7 @@ unsafe fn html_constructor(
construction_stack.push(ConstructionStackEntry::AlreadyConstructedMarker);
// Step 13
if !check_type(&*element) {
if !check_type(&element) {
throw_dom_exception(cx, global, Error::InvalidState);
return Err(());
} else {