mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
clippy: Fix unnecessary_cast
warnings in components/script
(#31823)
* clippy: Fix unnecessary cast warnings * clippy: Replace redundant field names with their shorthand alternatives * clippy: Delete struct pattern dereferencings
This commit is contained in:
parent
3e9b808938
commit
bae77671f8
21 changed files with 32 additions and 45 deletions
|
@ -451,7 +451,7 @@ pub unsafe extern "C" fn resolve_global(
|
|||
let mut length = 0;
|
||||
let ptr = JS_GetLatin1StringCharsAndLength(cx, ptr::null(), string, &mut length);
|
||||
assert!(!ptr.is_null());
|
||||
let bytes = slice::from_raw_parts(ptr, length as usize);
|
||||
let bytes = slice::from_raw_parts(ptr, length);
|
||||
|
||||
if let Some(init_fun) = InterfaceObjectMap::MAP.get(bytes) {
|
||||
init_fun(SafeJSContext::from_ptr(cx), Handle::from_raw(obj));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue