Skip to content

Commit

Permalink
Silence unused warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 4, 2019
1 parent feb2a2d commit c3b93a9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
13 changes: 1 addition & 12 deletions components/script/dom/xrlayer.rs
Expand Up @@ -2,10 +2,7 @@
* 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/. */

use crate::dom::bindings::codegen::Bindings::XRLayerBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use crate::dom::bindings::reflector::Reflector;
use dom_struct::dom_struct;

#[dom_struct]
Expand All @@ -19,12 +16,4 @@ impl XRLayer {
reflector_: Reflector::new(),
}
}

pub fn new(global: &GlobalScope) -> DomRoot<XRLayer> {
reflect_dom_object(
Box::new(XRLayer::new_inherited()),
global,
XRLayerBinding::Wrap,
)
}
}
1 change: 1 addition & 0 deletions components/script/dom/xrreferencespace.rs
Expand Up @@ -21,6 +21,7 @@ impl XRReferenceSpace {
}
}

#[allow(unused)]
pub fn new(global: &GlobalScope) -> DomRoot<XRReferenceSpace> {
reflect_dom_object(
Box::new(XRReferenceSpace::new_inherited()),
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/xrrigidtransform.rs
Expand Up @@ -20,6 +20,7 @@ impl XRRigidTransform {
}
}

#[allow(unused)]
pub fn new(global: &GlobalScope) -> DomRoot<XRRigidTransform> {
reflect_dom_object(
Box::new(XRRigidTransform::new_inherited()),
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/xrstationaryreferencespace.rs
Expand Up @@ -14,6 +14,7 @@ pub struct XRStationaryReferenceSpace {
xrreferencespace: XRReferenceSpace,
}

#[allow(unused)]
impl XRStationaryReferenceSpace {
pub fn new_inherited() -> XRStationaryReferenceSpace {
XRStationaryReferenceSpace {
Expand Down
26 changes: 12 additions & 14 deletions components/script/dom/xrwebgllayer.rs
Expand Up @@ -18,15 +18,13 @@ use crate::dom::xrview::XRView;
use crate::dom::xrviewport::XRViewport;
use dom_struct::dom_struct;

use std::cell::Cell;

#[dom_struct]
pub struct XRWebGLLayer {
xrlayer: XRLayer,
antialias: Cell<bool>,
depth: Cell<bool>,
stencil: Cell<bool>,
alpha: Cell<bool>,
antialias: bool,
depth: bool,
stencil: bool,
alpha: bool,
context: Dom<WebGLRenderingContext>,
session: Dom<XRSession>,
}
Expand All @@ -39,10 +37,10 @@ impl XRWebGLLayer {
) -> XRWebGLLayer {
XRWebGLLayer {
xrlayer: XRLayer::new_inherited(),
antialias: Cell::new(init.antialias),
depth: Cell::new(init.depth),
stencil: Cell::new(init.stencil),
alpha: Cell::new(init.alpha),
antialias: init.antialias,
depth: init.depth,
stencil: init.stencil,
alpha: init.alpha,
context: Dom::from_ref(context),
session: Dom::from_ref(session),
}
Expand Down Expand Up @@ -74,22 +72,22 @@ impl XRWebGLLayer {
impl XRWebGLLayerMethods for XRWebGLLayer {
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-depth
fn Depth(&self) -> bool {
self.depth.get()
self.depth
}

/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-stencil
fn Stencil(&self) -> bool {
self.stencil.get()
self.stencil
}

/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-antialias
fn Antialias(&self) -> bool {
self.antialias.get()
self.antialias
}

/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-alpha
fn Alpha(&self) -> bool {
self.alpha.get()
self.alpha
}

/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-context
Expand Down

0 comments on commit c3b93a9

Please sign in to comment.