mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
chore: Fix two compiler warnings (#33421)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b1486d311a
commit
37ab4b9825
2 changed files with 6 additions and 3 deletions
|
@ -6755,12 +6755,15 @@ class CGDictionary(CGThing):
|
||||||
initParent = f"parent: {initParent},\n" if initParent else ""
|
initParent = f"parent: {initParent},\n" if initParent else ""
|
||||||
memberInits = CGList([memberInit(m, True) for m in self.memberInfo])
|
memberInits = CGList([memberInit(m, True) for m in self.memberInfo])
|
||||||
|
|
||||||
|
unsafe_if_necessary = "unsafe"
|
||||||
|
if not initParent and not memberInits:
|
||||||
|
unsafe_if_necessary = ""
|
||||||
return (
|
return (
|
||||||
f"impl {selfName} {{\n"
|
f"impl {selfName} {{\n"
|
||||||
f"{CGIndenter(CGGeneric(self.makeEmpty()), indentLevel=4).define()}\n"
|
f"{CGIndenter(CGGeneric(self.makeEmpty()), indentLevel=4).define()}\n"
|
||||||
" pub fn new(cx: SafeJSContext, val: HandleValue) \n"
|
" pub fn new(cx: SafeJSContext, val: HandleValue) \n"
|
||||||
f" -> Result<ConversionResult<{actualType}>, ()> {{\n"
|
f" -> Result<ConversionResult<{actualType}>, ()> {{\n"
|
||||||
" unsafe {\n"
|
f" {unsafe_if_necessary} {{\n"
|
||||||
" let object = if val.get().is_null_or_undefined() {\n"
|
" let object = if val.get().is_null_or_undefined() {\n"
|
||||||
" ptr::null_mut()\n"
|
" ptr::null_mut()\n"
|
||||||
" } else if val.get().is_object() {\n"
|
" } else if val.get().is_object() {\n"
|
||||||
|
|
|
@ -11,8 +11,8 @@ use ipc_channel::ipc::IpcSender;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use profile_traits::ipc;
|
use profile_traits::ipc;
|
||||||
use webxr_api::{
|
use webxr_api::{
|
||||||
EntityType, Handedness, InputId, InputSource, MockButton, MockDeviceMsg, MockInputInit,
|
EntityType, Handedness, InputId, InputSource, MockDeviceMsg, MockInputInit, MockRegion,
|
||||||
MockRegion, MockViewInit, MockViewsInit, MockWorld, TargetRayMode, Triangle, Visibility,
|
MockViewInit, MockViewsInit, MockWorld, TargetRayMode, Triangle, Visibility,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
|
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue