clippy: Fix warnings in components/script (#31700)

* Fix warnings: immediate dereferencing of references and unneeded  statement

* Fix warnings in Components/script
This commit is contained in:
Richard Dushime 2024-03-15 13:27:50 -04:00 committed by GitHub
parent 47a4ce467f
commit 8a6481c341
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -300,10 +300,10 @@ pub fn handle_execute_script(
global.evaluate_js_on_global_with_result(
&eval,
rval.handle_mut(),
ScriptFetchOptions::default_classic_script(&global),
ScriptFetchOptions::default_classic_script(global),
global.api_base_url(),
);
jsval_to_webdriver(*cx, &window.upcast::<GlobalScope>(), rval.handle())
jsval_to_webdriver(*cx, window.upcast::<GlobalScope>(), rval.handle())
};
reply.send(result).unwrap();
@ -330,7 +330,7 @@ pub fn handle_execute_async_script(
global.evaluate_js_on_global_with_result(
&eval,
rval.handle_mut(),
ScriptFetchOptions::default_classic_script(&global),
ScriptFetchOptions::default_classic_script(global),
global.api_base_url(),
);
},
@ -1048,7 +1048,7 @@ pub fn handle_get_css(
let element = node.downcast::<Element>().unwrap();
Ok(String::from(
window
.GetComputedStyle(&element, None)
.GetComputedStyle(element, None)
.GetPropertyValue(DOMString::from(name)),
))
}),
@ -1173,7 +1173,7 @@ pub fn handle_is_enabled(
) {
reply
.send(
find_node_by_unique_id(&documents, pipeline, element_id).and_then(|node| match node
find_node_by_unique_id(documents, pipeline, element_id).and_then(|node| match node
.downcast::<Element>(
) {
Some(element) => Ok(element.enabled_state()),