mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Add as_void_ptr helper method to &T <!-- Please describe your changes on the following line: --> r? @jdm issue https://github.com/servo/servo/issues/15252 The primary goal of this PR is to add add a generic trait method that returns a void ptr. In addition to that change, I made the casting explicit in `components/script/dom/bindings/callback.rs` and `components/script/dom/promise.rs`. I did not use the new trait method because `AddRawValueRoot` is not looking for a `c_void`. It's looking for `std::os::raw::c_char`. ```rust pub fn AddRawValueRoot(cx: *mut JSContext, vp: *mut Value, name: *const ::std::os::raw::c_char) -> bool; ``` So I replace the `as *const _ ` with a more specific cast. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #15252 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because This seems like code cleanup. It shouldn't change behaviour. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16234) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
atoms | ||
bluetooth | ||
bluetooth_traits | ||
canvas | ||
canvas_traits | ||
compositing | ||
config | ||
constellation | ||
debugger | ||
deny_public_fields | ||
devtools | ||
devtools_traits | ||
dom_struct | ||
domobject_derive | ||
geometry | ||
gfx | ||
gfx_traits | ||
jstraceable_derive | ||
layout | ||
layout_thread | ||
layout_traits | ||
msg | ||
net | ||
net_traits | ||
profile | ||
profile_traits | ||
rand | ||
range | ||
remutex | ||
script | ||
script_layout_interface | ||
script_plugins | ||
script_traits | ||
selectors | ||
servo | ||
style | ||
style_traits | ||
url | ||
webdriver_server | ||
webvr | ||
webvr_traits |