diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2023-09-11 21:16:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-11 19:16:54 +0000 |
commit | aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4 (patch) | |
tree | 68dec1a9d53f4ed564843a9580fba70bf90dbef1 /components/script/dom/webgl_extensions | |
parent | 413da4ca69d3013528c09bbaf38629a72384372d (diff) | |
download | servo-aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4.tar.gz servo-aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4.zip |
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting
* Reformat all imports
Diffstat (limited to 'components/script/dom/webgl_extensions')
20 files changed, 71 insertions, 49 deletions
diff --git a/components/script/dom/webgl_extensions/ext/angleinstancedarrays.rs b/components/script/dom/webgl_extensions/ext/angleinstancedarrays.rs index 4d03f25781b..5c79a692adb 100644 --- a/components/script/dom/webgl_extensions/ext/angleinstancedarrays.rs +++ b/components/script/dom/webgl_extensions/ext/angleinstancedarrays.rs @@ -2,14 +2,16 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; -use crate::dom::bindings::codegen::Bindings::ANGLEInstancedArraysBinding::ANGLEInstancedArraysConstants; -use crate::dom::bindings::codegen::Bindings::ANGLEInstancedArraysBinding::ANGLEInstancedArraysMethods; +use crate::dom::bindings::codegen::Bindings::ANGLEInstancedArraysBinding::{ + ANGLEInstancedArraysConstants, ANGLEInstancedArraysMethods, +}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct ANGLEInstancedArrays { diff --git a/components/script/dom/webgl_extensions/ext/extblendminmax.rs b/components/script/dom/webgl_extensions/ext/extblendminmax.rs index 122aac6c861..97c4a642f9b 100644 --- a/components/script/dom/webgl_extensions/ext/extblendminmax.rs +++ b/components/script/dom/webgl_extensions/ext/extblendminmax.rs @@ -2,12 +2,13 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct EXTBlendMinmax { diff --git a/components/script/dom/webgl_extensions/ext/extcolorbufferhalffloat.rs b/components/script/dom/webgl_extensions/ext/extcolorbufferhalffloat.rs index bb4a630d537..48d69b78ab4 100644 --- a/components/script/dom/webgl_extensions/ext/extcolorbufferhalffloat.rs +++ b/components/script/dom/webgl_extensions/ext/extcolorbufferhalffloat.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webgl_extensions::ext::oestexturehalffloat::OESTextureHalfFloat; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct EXTColorBufferHalfFloat { diff --git a/components/script/dom/webgl_extensions/ext/extfragdepth.rs b/components/script/dom/webgl_extensions/ext/extfragdepth.rs index 182b30bf754..056286137a4 100644 --- a/components/script/dom/webgl_extensions/ext/extfragdepth.rs +++ b/components/script/dom/webgl_extensions/ext/extfragdepth.rs @@ -2,12 +2,13 @@ * 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 canvas_traits::webgl::{WebGLSLVersion, WebGLVersion}; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::{WebGLSLVersion, WebGLVersion}; -use dom_struct::dom_struct; #[dom_struct] pub struct EXTFragDepth { diff --git a/components/script/dom/webgl_extensions/ext/extshadertexturelod.rs b/components/script/dom/webgl_extensions/ext/extshadertexturelod.rs index ea68b518dac..65c39edb6a2 100644 --- a/components/script/dom/webgl_extensions/ext/extshadertexturelod.rs +++ b/components/script/dom/webgl_extensions/ext/extshadertexturelod.rs @@ -2,12 +2,13 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct EXTShaderTextureLod { diff --git a/components/script/dom/webgl_extensions/ext/exttexturefilteranisotropic.rs b/components/script/dom/webgl_extensions/ext/exttexturefilteranisotropic.rs index 89a4d3ed6a4..c5de4cea880 100644 --- a/components/script/dom/webgl_extensions/ext/exttexturefilteranisotropic.rs +++ b/components/script/dom/webgl_extensions/ext/exttexturefilteranisotropic.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::codegen::Bindings::EXTTextureFilterAnisotropicBinding::EXTTextureFilterAnisotropicConstants; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct EXTTextureFilterAnisotropic { diff --git a/components/script/dom/webgl_extensions/ext/oeselementindexuint.rs b/components/script/dom/webgl_extensions/ext/oeselementindexuint.rs index 096c22d3dc5..77ba300caef 100644 --- a/components/script/dom/webgl_extensions/ext/oeselementindexuint.rs +++ b/components/script/dom/webgl_extensions/ext/oeselementindexuint.rs @@ -2,12 +2,13 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct OESElementIndexUint { diff --git a/components/script/dom/webgl_extensions/ext/oesstandardderivatives.rs b/components/script/dom/webgl_extensions/ext/oesstandardderivatives.rs index dfafa7051a5..9a552216cc4 100644 --- a/components/script/dom/webgl_extensions/ext/oesstandardderivatives.rs +++ b/components/script/dom/webgl_extensions/ext/oesstandardderivatives.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::codegen::Bindings::OESStandardDerivativesBinding::OESStandardDerivativesConstants; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct OESStandardDerivatives { diff --git a/components/script/dom/webgl_extensions/ext/oestexturefloat.rs b/components/script/dom/webgl_extensions/ext/oestexturefloat.rs index e286095b7c7..b7d87594a42 100644 --- a/components/script/dom/webgl_extensions/ext/oestexturefloat.rs +++ b/components/script/dom/webgl_extensions/ext/oestexturefloat.rs @@ -2,12 +2,13 @@ * 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 canvas_traits::webgl::{TexFormat, WebGLVersion}; +use dom_struct::dom_struct; + use super::{constants as webgl, WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::{TexFormat, WebGLVersion}; -use dom_struct::dom_struct; #[dom_struct] pub struct OESTextureFloat { diff --git a/components/script/dom/webgl_extensions/ext/oestexturefloatlinear.rs b/components/script/dom/webgl_extensions/ext/oestexturefloatlinear.rs index 9e5c021f0ef..eee682a4327 100644 --- a/components/script/dom/webgl_extensions/ext/oestexturefloatlinear.rs +++ b/components/script/dom/webgl_extensions/ext/oestexturefloatlinear.rs @@ -2,11 +2,12 @@ * 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 dom_struct::dom_struct; + use super::{constants as webgl, WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use dom_struct::dom_struct; #[dom_struct] pub struct OESTextureFloatLinear { diff --git a/components/script/dom/webgl_extensions/ext/oestexturehalffloat.rs b/components/script/dom/webgl_extensions/ext/oestexturehalffloat.rs index 4f2ef41c651..49724a1aa21 100644 --- a/components/script/dom/webgl_extensions/ext/oestexturehalffloat.rs +++ b/components/script/dom/webgl_extensions/ext/oestexturehalffloat.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::{TexFormat, WebGLVersion}; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::{TexFormat, WebGLVersion}; -use dom_struct::dom_struct; #[dom_struct] pub struct OESTextureHalfFloat { diff --git a/components/script/dom/webgl_extensions/ext/oestexturehalffloatlinear.rs b/components/script/dom/webgl_extensions/ext/oestexturehalffloatlinear.rs index a1e5f3bf15d..c25bf855b6e 100644 --- a/components/script/dom/webgl_extensions/ext/oestexturehalffloatlinear.rs +++ b/components/script/dom/webgl_extensions/ext/oestexturehalffloatlinear.rs @@ -2,12 +2,13 @@ * 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 dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use dom_struct::dom_struct; #[dom_struct] pub struct OESTextureHalfFloatLinear { diff --git a/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs b/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs index 57a68142609..4ddb5c2fb52 100644 --- a/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs +++ b/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs @@ -2,15 +2,17 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; -use crate::dom::bindings::codegen::Bindings::OESVertexArrayObjectBinding::OESVertexArrayObjectConstants; -use crate::dom::bindings::codegen::Bindings::OESVertexArrayObjectBinding::OESVertexArrayObjectMethods; +use crate::dom::bindings::codegen::Bindings::OESVertexArrayObjectBinding::{ + OESVertexArrayObjectConstants, OESVertexArrayObjectMethods, +}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::webglrenderingcontext::WebGLRenderingContext; use crate::dom::webglvertexarrayobjectoes::WebGLVertexArrayObjectOES; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct OESVertexArrayObject { diff --git a/components/script/dom/webgl_extensions/ext/webglcolorbufferfloat.rs b/components/script/dom/webgl_extensions/ext/webglcolorbufferfloat.rs index c0d8dc13776..30466b49cdc 100644 --- a/components/script/dom/webgl_extensions/ext/webglcolorbufferfloat.rs +++ b/components/script/dom/webgl_extensions/ext/webglcolorbufferfloat.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::WebGLVersion; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webgl_extensions::ext::oestexturefloat::OESTextureFloat; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; -use dom_struct::dom_struct; #[dom_struct] pub struct WEBGLColorBufferFloat { diff --git a/components/script/dom/webgl_extensions/ext/webglcompressedtextureetc1.rs b/components/script/dom/webgl_extensions/ext/webglcompressedtextureetc1.rs index 749c38abd82..c04dceebca0 100644 --- a/components/script/dom/webgl_extensions/ext/webglcompressedtextureetc1.rs +++ b/components/script/dom/webgl_extensions/ext/webglcompressedtextureetc1.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::{TexFormat, WebGLVersion}; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; use crate::dom::webgltexture::{TexCompression, TexCompressionValidation}; -use canvas_traits::webgl::{TexFormat, WebGLVersion}; -use dom_struct::dom_struct; #[dom_struct] pub struct WEBGLCompressedTextureETC1 { diff --git a/components/script/dom/webgl_extensions/ext/webglcompressedtextures3tc.rs b/components/script/dom/webgl_extensions/ext/webglcompressedtextures3tc.rs index 362dbe67117..22d9899db43 100644 --- a/components/script/dom/webgl_extensions/ext/webglcompressedtextures3tc.rs +++ b/components/script/dom/webgl_extensions/ext/webglcompressedtextures3tc.rs @@ -2,13 +2,14 @@ * 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 canvas_traits::webgl::{TexFormat, WebGLVersion}; +use dom_struct::dom_struct; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::webglrenderingcontext::WebGLRenderingContext; use crate::dom::webgltexture::{TexCompression, TexCompressionValidation}; -use canvas_traits::webgl::{TexFormat, WebGLVersion}; -use dom_struct::dom_struct; #[dom_struct] pub struct WEBGLCompressedTextureS3TC { diff --git a/components/script/dom/webgl_extensions/extension.rs b/components/script/dom/webgl_extensions/extension.rs index 3854acee122..876b19cb8a9 100644 --- a/components/script/dom/webgl_extensions/extension.rs +++ b/components/script/dom/webgl_extensions/extension.rs @@ -2,12 +2,13 @@ * 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 canvas_traits::webgl::WebGLVersion; + use super::WebGLExtensions; use crate::dom::bindings::reflector::DomObject; use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::trace::JSTraceable; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use canvas_traits::webgl::WebGLVersion; /// Trait implemented by WebGL extensions. pub trait WebGLExtension: Sized diff --git a/components/script/dom/webgl_extensions/extensions.rs b/components/script/dom/webgl_extensions/extensions.rs index 4873b3638e8..4c1bf37d0e4 100644 --- a/components/script/dom/webgl_extensions/extensions.rs +++ b/components/script/dom/webgl_extensions/extensions.rs @@ -2,6 +2,16 @@ * 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 std::collections::HashMap; +use std::iter::FromIterator; +use std::ptr::NonNull; + +use canvas_traits::webgl::{GlType, TexFormat, WebGLSLVersion, WebGLVersion}; +use fnv::{FnvHashMap, FnvHashSet}; +use js::jsapi::JSObject; +use malloc_size_of::MallocSizeOf; +use sparkle::gl::{self, GLenum}; + use super::wrapper::{TypedWebGLExtensionWrapper, WebGLExtensionWrapper}; use super::{ext, WebGLExtension, WebGLExtensionSpec}; use crate::dom::bindings::cell::DomRefCell; @@ -18,14 +28,6 @@ use crate::dom::oestexturehalffloat::OESTextureHalfFloat; use crate::dom::webglcolorbufferfloat::WEBGLColorBufferFloat; use crate::dom::webglrenderingcontext::WebGLRenderingContext; use crate::dom::webgltexture::TexCompression; -use canvas_traits::webgl::{GlType, TexFormat, WebGLSLVersion, WebGLVersion}; -use fnv::{FnvHashMap, FnvHashSet}; -use js::jsapi::JSObject; -use malloc_size_of::MallocSizeOf; -use sparkle::gl::{self, GLenum}; -use std::collections::HashMap; -use std::iter::FromIterator; -use std::ptr::NonNull; // Data types that are implemented for texImage2D and texSubImage2D in a WebGL 1.0 context // but must trigger a InvalidValue error until the related WebGL Extensions are enabled. diff --git a/components/script/dom/webgl_extensions/mod.rs b/components/script/dom/webgl_extensions/mod.rs index aa6dfd1c752..df91a5e00d1 100644 --- a/components/script/dom/webgl_extensions/mod.rs +++ b/components/script/dom/webgl_extensions/mod.rs @@ -7,6 +7,5 @@ mod extension; mod extensions; mod wrapper; -pub use self::extension::WebGLExtension; -pub use self::extension::WebGLExtensionSpec; +pub use self::extension::{WebGLExtension, WebGLExtensionSpec}; pub use self::extensions::WebGLExtensions; diff --git a/components/script/dom/webgl_extensions/wrapper.rs b/components/script/dom/webgl_extensions/wrapper.rs index bf8db31418c..84338640835 100644 --- a/components/script/dom/webgl_extensions/wrapper.rs +++ b/components/script/dom/webgl_extensions/wrapper.rs @@ -2,15 +2,17 @@ * 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 std::any::Any; +use std::ptr::NonNull; + +use js::jsapi::JSObject; +use malloc_size_of::MallocSizeOf; + use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions}; use crate::dom::bindings::reflector::DomObject; use crate::dom::bindings::root::MutNullableDom; use crate::dom::bindings::trace::JSTraceable; use crate::dom::webglrenderingcontext::WebGLRenderingContext; -use js::jsapi::JSObject; -use malloc_size_of::MallocSizeOf; -use std::any::Any; -use std::ptr::NonNull; /// Trait used internally by WebGLExtensions to store and /// handle the different WebGL extensions in a common list. |