mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
script: Replace allow(unused_imports)
with conditional use
statements (#38576)
A few places in the code are using a blanket `allow(unused_imports)` compiler directive to silence errors about unused imports when the `webxr` feature is disabled. Since this can hide other kinds of unused imports, replace these directives with conditional `use` statements. Testing: No behavior change, so existing tests suffice. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
4d7a0d3863
commit
d5d3ad6949
2 changed files with 7 additions and 6 deletions
|
@ -2,8 +2,6 @@
|
||||||
* 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/. */
|
||||||
|
|
||||||
#![allow(unused_imports)]
|
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
@ -12,6 +10,7 @@ use canvas_traits::webgl::{
|
||||||
WebGLRenderbufferId, WebGLResult, WebGLTextureId, WebGLVersion, webgl_channel,
|
WebGLRenderbufferId, WebGLResult, WebGLTextureId, WebGLVersion, webgl_channel,
|
||||||
};
|
};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
|
#[cfg(feature = "webxr")]
|
||||||
use euclid::Size2D;
|
use euclid::Size2D;
|
||||||
use script_bindings::weakref::WeakRef;
|
use script_bindings::weakref::WeakRef;
|
||||||
#[cfg(feature = "webxr")]
|
#[cfg(feature = "webxr")]
|
||||||
|
@ -21,7 +20,9 @@ use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as constants;
|
use crate::dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as constants;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{DomGlobal, reflect_dom_object};
|
use crate::dom::bindings::reflector::{DomGlobal, reflect_dom_object};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
#[cfg(feature = "webxr")]
|
||||||
|
use crate::dom::bindings::root::MutNullableDom;
|
||||||
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
use crate::dom::webglobject::WebGLObject;
|
use crate::dom::webglobject::WebGLObject;
|
||||||
use crate::dom::webglrenderbuffer::WebGLRenderbuffer;
|
use crate::dom::webglrenderbuffer::WebGLRenderbuffer;
|
||||||
use crate::dom::webglrenderingcontext::{Operation, WebGLRenderingContext};
|
use crate::dom::webglrenderingcontext::{Operation, WebGLRenderingContext};
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
* 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/. */
|
||||||
|
|
||||||
#![allow(unused_imports)]
|
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
@ -20,7 +18,9 @@ use crate::dom::bindings::codegen::Bindings::EXTTextureFilterAnisotropicBinding:
|
||||||
use crate::dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as constants;
|
use crate::dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as constants;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{DomGlobal, reflect_dom_object};
|
use crate::dom::bindings::reflector::{DomGlobal, reflect_dom_object};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
#[cfg(feature = "webxr")]
|
||||||
|
use crate::dom::bindings::root::Dom;
|
||||||
|
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
||||||
use crate::dom::webgl_validations::types::TexImageTarget;
|
use crate::dom::webgl_validations::types::TexImageTarget;
|
||||||
use crate::dom::webglframebuffer::WebGLFramebuffer;
|
use crate::dom::webglframebuffer::WebGLFramebuffer;
|
||||||
use crate::dom::webglobject::WebGLObject;
|
use crate::dom::webglobject::WebGLObject;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue