Silence unused warnings

This commit is contained in:
Manish Goregaokar 2018-12-23 15:54:33 -08:00
parent feb2a2d3c9
commit c3b93a967d
5 changed files with 16 additions and 26 deletions

View file

@ -2,10 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::XRLayerBinding; use crate::dom::bindings::reflector::Reflector;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct; use dom_struct::dom_struct;
#[dom_struct] #[dom_struct]
@ -19,12 +16,4 @@ impl XRLayer {
reflector_: Reflector::new(), reflector_: Reflector::new(),
} }
} }
pub fn new(global: &GlobalScope) -> DomRoot<XRLayer> {
reflect_dom_object(
Box::new(XRLayer::new_inherited()),
global,
XRLayerBinding::Wrap,
)
}
} }

View file

@ -21,6 +21,7 @@ impl XRReferenceSpace {
} }
} }
#[allow(unused)]
pub fn new(global: &GlobalScope) -> DomRoot<XRReferenceSpace> { pub fn new(global: &GlobalScope) -> DomRoot<XRReferenceSpace> {
reflect_dom_object( reflect_dom_object(
Box::new(XRReferenceSpace::new_inherited()), Box::new(XRReferenceSpace::new_inherited()),

View file

@ -20,6 +20,7 @@ impl XRRigidTransform {
} }
} }
#[allow(unused)]
pub fn new(global: &GlobalScope) -> DomRoot<XRRigidTransform> { pub fn new(global: &GlobalScope) -> DomRoot<XRRigidTransform> {
reflect_dom_object( reflect_dom_object(
Box::new(XRRigidTransform::new_inherited()), Box::new(XRRigidTransform::new_inherited()),

View file

@ -14,6 +14,7 @@ pub struct XRStationaryReferenceSpace {
xrreferencespace: XRReferenceSpace, xrreferencespace: XRReferenceSpace,
} }
#[allow(unused)]
impl XRStationaryReferenceSpace { impl XRStationaryReferenceSpace {
pub fn new_inherited() -> XRStationaryReferenceSpace { pub fn new_inherited() -> XRStationaryReferenceSpace {
XRStationaryReferenceSpace { XRStationaryReferenceSpace {

View file

@ -18,15 +18,13 @@ use crate::dom::xrview::XRView;
use crate::dom::xrviewport::XRViewport; use crate::dom::xrviewport::XRViewport;
use dom_struct::dom_struct; use dom_struct::dom_struct;
use std::cell::Cell;
#[dom_struct] #[dom_struct]
pub struct XRWebGLLayer { pub struct XRWebGLLayer {
xrlayer: XRLayer, xrlayer: XRLayer,
antialias: Cell<bool>, antialias: bool,
depth: Cell<bool>, depth: bool,
stencil: Cell<bool>, stencil: bool,
alpha: Cell<bool>, alpha: bool,
context: Dom<WebGLRenderingContext>, context: Dom<WebGLRenderingContext>,
session: Dom<XRSession>, session: Dom<XRSession>,
} }
@ -39,10 +37,10 @@ impl XRWebGLLayer {
) -> XRWebGLLayer { ) -> XRWebGLLayer {
XRWebGLLayer { XRWebGLLayer {
xrlayer: XRLayer::new_inherited(), xrlayer: XRLayer::new_inherited(),
antialias: Cell::new(init.antialias), antialias: init.antialias,
depth: Cell::new(init.depth), depth: init.depth,
stencil: Cell::new(init.stencil), stencil: init.stencil,
alpha: Cell::new(init.alpha), alpha: init.alpha,
context: Dom::from_ref(context), context: Dom::from_ref(context),
session: Dom::from_ref(session), session: Dom::from_ref(session),
} }
@ -74,22 +72,22 @@ impl XRWebGLLayer {
impl XRWebGLLayerMethods for XRWebGLLayer { impl XRWebGLLayerMethods for XRWebGLLayer {
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-depth /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-depth
fn Depth(&self) -> bool { fn Depth(&self) -> bool {
self.depth.get() self.depth
} }
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-stencil /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-stencil
fn Stencil(&self) -> bool { fn Stencil(&self) -> bool {
self.stencil.get() self.stencil
} }
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-antialias /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-antialias
fn Antialias(&self) -> bool { fn Antialias(&self) -> bool {
self.antialias.get() self.antialias
} }
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-alpha /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-alpha
fn Alpha(&self) -> bool { fn Alpha(&self) -> bool {
self.alpha.get() self.alpha
} }
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-context /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-context