From 8a6481c3411543a79b7fdc2fdb191dfa85c33111 Mon Sep 17 00:00:00 2001 From: Richard Dushime <45734838+richarddushime@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:27:50 -0400 Subject: [PATCH] clippy: Fix warnings in `components/script` (#31700) * Fix warnings: immediate dereferencing of references and unneeded statement * Fix warnings in Components/script --- components/script/webdriver_handlers.rs | 10 +++++----- components/script/window_named_properties.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index a4014a699d9..700a15cde7e 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -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::(), rval.handle()) + jsval_to_webdriver(*cx, window.upcast::(), 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::().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::( ) { Some(element) => Ok(element.enabled_state()), diff --git a/components/script/window_named_properties.rs b/components/script/window_named_properties.rs index 0140bd7c46e..bf0d384e3cd 100644 --- a/components/script/window_named_properties.rs +++ b/components/script/window_named_properties.rs @@ -142,7 +142,7 @@ unsafe extern "C" fn get_own_property_descriptor( &mut *is_none, ); } - return true; + true } #[allow(unsafe_code)]