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
|
@ -422,14 +422,13 @@ where
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let mapping_slice_ptr =
|
||||
mapping.lock().unwrap().borrow_mut()[offset as usize..m_end as usize].as_mut_ptr();
|
||||
let mapping_slice_ptr = mapping.lock().unwrap().borrow_mut()[offset..m_end].as_mut_ptr();
|
||||
|
||||
// rooted! is needed to ensure memory safety and prevent potential garbage collection issues.
|
||||
// https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/esr78/docs/GC%20Rooting%20Guide.md#performance-tweaking
|
||||
rooted!(in(*cx) let array_buffer = NewExternalArrayBuffer(
|
||||
*cx,
|
||||
range_size as usize,
|
||||
range_size,
|
||||
mapping_slice_ptr as _,
|
||||
Some(free_func),
|
||||
Arc::into_raw(mapping) as _,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue