aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2023-09-11 21:16:54 +0200
committerGitHub <noreply@github.com>2023-09-11 19:16:54 +0000
commitaad2dccc9c9f6b89922c07933cfa7087a8cd1ec4 (patch)
tree68dec1a9d53f4ed564843a9580fba70bf90dbef1 /components/canvas_traits
parent413da4ca69d3013528c09bbaf38629a72384372d (diff)
downloadservo-aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4.tar.gz
servo-aad2dccc9c9f6b89922c07933cfa7087a8cd1ec4.zip
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting * Reformat all imports
Diffstat (limited to 'components/canvas_traits')
-rw-r--r--components/canvas_traits/canvas.rs5
-rw-r--r--components/canvas_traits/lib.rs3
-rw-r--r--components/canvas_traits/webgl.rs18
-rw-r--r--components/canvas_traits/webgl_channel/ipc.rs3
-rw-r--r--components/canvas_traits/webgl_channel/mod.rs6
-rw-r--r--components/canvas_traits/webgl_channel/mpsc.rs3
6 files changed, 21 insertions, 17 deletions
diff --git a/components/canvas_traits/canvas.rs b/components/canvas_traits/canvas.rs
index 6065b714ce0..ee29d440efb 100644
--- a/components/canvas_traits/canvas.rs
+++ b/components/canvas_traits/canvas.rs
@@ -2,14 +2,15 @@
* 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::default::Default;
+use std::str::FromStr;
+
use cssparser::RGBA;
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
use ipc_channel::ipc::{IpcBytesReceiver, IpcBytesSender, IpcSender, IpcSharedMemory};
use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;
-use std::default::Default;
-use std::str::FromStr;
use style::properties::style_structs::Font as FontStyleStruct;
use webrender_api::ImageKey;
diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs
index e7aeef0fb67..e0c4050e7be 100644
--- a/components/canvas_traits/lib.rs
+++ b/components/canvas_traits/lib.rs
@@ -6,10 +6,11 @@
#![crate_type = "rlib"]
#![deny(unsafe_code)]
-use crate::canvas::CanvasId;
use crossbeam_channel::Sender;
use euclid::default::Size2D;
+use crate::canvas::CanvasId;
+
pub mod canvas;
#[macro_use]
pub mod webgl;
diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs
index 914b06e7b9f..2a2e0f0c3b3 100644
--- a/components/canvas_traits/webgl.rs
+++ b/components/canvas_traits/webgl.rs
@@ -2,22 +2,22 @@
* 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::borrow::Cow;
+use std::fmt;
+use std::num::{NonZeroU32, NonZeroU64};
+use std::ops::Deref;
+
use euclid::default::{Rect, Size2D};
use ipc_channel::ipc::{IpcBytesReceiver, IpcBytesSender, IpcSharedMemory};
use malloc_size_of_derive::MallocSizeOf;
use pixels::PixelFormat;
use serde::{Deserialize, Serialize};
use sparkle::gl;
-use std::borrow::Cow;
-use std::fmt;
-use std::num::{NonZeroU32, NonZeroU64};
-use std::ops::Deref;
use webrender_api::ImageKey;
-use webxr_api::ContextId as WebXRContextId;
-use webxr_api::Error as WebXRError;
-use webxr_api::LayerId as WebXRLayerId;
-use webxr_api::LayerInit as WebXRLayerInit;
-use webxr_api::SubImages as WebXRSubImages;
+use webxr_api::{
+ ContextId as WebXRContextId, Error as WebXRError, LayerId as WebXRLayerId,
+ LayerInit as WebXRLayerInit, SubImages as WebXRSubImages,
+};
/// Helper function that creates a WebGL channel (WebGLSender, WebGLReceiver) to be used in WebGLCommands.
pub use crate::webgl_channel::webgl_channel;
diff --git a/components/canvas_traits/webgl_channel/ipc.rs b/components/canvas_traits/webgl_channel/ipc.rs
index 0eb940c440f..be320a69624 100644
--- a/components/canvas_traits/webgl_channel/ipc.rs
+++ b/components/canvas_traits/webgl_channel/ipc.rs
@@ -2,9 +2,10 @@
* 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 serde::{Deserialize, Serialize};
use std::io;
+use serde::{Deserialize, Serialize};
+
pub type WebGLSender<T> = ipc_channel::ipc::IpcSender<T>;
pub type WebGLReceiver<T> = ipc_channel::ipc::IpcReceiver<T>;
diff --git a/components/canvas_traits/webgl_channel/mod.rs b/components/canvas_traits/webgl_channel/mod.rs
index 6aa14187699..edfb90c8806 100644
--- a/components/canvas_traits/webgl_channel/mod.rs
+++ b/components/canvas_traits/webgl_channel/mod.rs
@@ -7,13 +7,15 @@
mod ipc;
mod mpsc;
-use crate::webgl::WebGLMsg;
+use std::fmt;
+
use ipc_channel::ipc::IpcSender;
use ipc_channel::router::ROUTER;
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use servo_config::opts;
-use std::fmt;
+
+use crate::webgl::WebGLMsg;
lazy_static! {
static ref IS_MULTIPROCESS: bool = opts::multiprocess();
diff --git a/components/canvas_traits/webgl_channel/mpsc.rs b/components/canvas_traits/webgl_channel/mpsc.rs
index 8e34bda8e9b..b7d0bfcc3da 100644
--- a/components/canvas_traits/webgl_channel/mpsc.rs
+++ b/components/canvas_traits/webgl_channel/mpsc.rs
@@ -2,8 +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 serde::{Deserialize, Serialize};
-use serde::{Deserializer, Serializer};
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
macro_rules! unreachable_serializable {
($name:ident) => {