mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
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:
parent
47a4ce467f
commit
8a6481c341
2 changed files with 6 additions and 6 deletions
|
@ -300,10 +300,10 @@ pub fn handle_execute_script(
|
||||||
global.evaluate_js_on_global_with_result(
|
global.evaluate_js_on_global_with_result(
|
||||||
&eval,
|
&eval,
|
||||||
rval.handle_mut(),
|
rval.handle_mut(),
|
||||||
ScriptFetchOptions::default_classic_script(&global),
|
ScriptFetchOptions::default_classic_script(global),
|
||||||
global.api_base_url(),
|
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();
|
reply.send(result).unwrap();
|
||||||
|
@ -330,7 +330,7 @@ pub fn handle_execute_async_script(
|
||||||
global.evaluate_js_on_global_with_result(
|
global.evaluate_js_on_global_with_result(
|
||||||
&eval,
|
&eval,
|
||||||
rval.handle_mut(),
|
rval.handle_mut(),
|
||||||
ScriptFetchOptions::default_classic_script(&global),
|
ScriptFetchOptions::default_classic_script(global),
|
||||||
global.api_base_url(),
|
global.api_base_url(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1048,7 +1048,7 @@ pub fn handle_get_css(
|
||||||
let element = node.downcast::<Element>().unwrap();
|
let element = node.downcast::<Element>().unwrap();
|
||||||
Ok(String::from(
|
Ok(String::from(
|
||||||
window
|
window
|
||||||
.GetComputedStyle(&element, None)
|
.GetComputedStyle(element, None)
|
||||||
.GetPropertyValue(DOMString::from(name)),
|
.GetPropertyValue(DOMString::from(name)),
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
|
@ -1173,7 +1173,7 @@ pub fn handle_is_enabled(
|
||||||
) {
|
) {
|
||||||
reply
|
reply
|
||||||
.send(
|
.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>(
|
.downcast::<Element>(
|
||||||
) {
|
) {
|
||||||
Some(element) => Ok(element.enabled_state()),
|
Some(element) => Ok(element.enabled_state()),
|
||||||
|
|
|
@ -142,7 +142,7 @@ unsafe extern "C" fn get_own_property_descriptor(
|
||||||
&mut *is_none,
|
&mut *is_none,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return true;
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue