Skip to content

Commit

Permalink
Reorder imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pyfisch committed Nov 6, 2018
1 parent 4a947dd commit 9e92eb2
Show file tree
Hide file tree
Showing 546 changed files with 1,964 additions and 1,532 deletions.
4 changes: 2 additions & 2 deletions components/allocator/lib.rs
Expand Up @@ -23,7 +23,7 @@ mod platform {

/// Memory allocation APIs compatible with libc
pub mod libc_compat {
pub use super::ffi::{malloc, realloc, free};
pub use super::ffi::{free, malloc, realloc};
}

pub struct Allocator;
Expand Down Expand Up @@ -98,8 +98,8 @@ mod platform {
mod platform {
extern crate kernel32;

pub use std::alloc::System as Allocator;
use self::kernel32::{GetProcessHeap, HeapSize, HeapValidate};
pub use std::alloc::System as Allocator;
use std::os::raw::c_void;

/// Get the size of a heap block.
Expand Down
2 changes: 1 addition & 1 deletion components/atoms/build.rs
Expand Up @@ -6,7 +6,7 @@ extern crate string_cache_codegen;

use std::env;
use std::fs::File;
use std::io::{BufReader, BufRead};
use std::io::{BufRead, BufReader};
use std::path::Path;

fn main() {
Expand Down
6 changes: 4 additions & 2 deletions components/bluetooth/lib.rs
Expand Up @@ -16,11 +16,13 @@ extern crate uuid;

pub mod test;

use bluetooth_traits::blocklist::{uuid_is_blocklisted, Blocklist};
use bluetooth_traits::scanfilter::{
BluetoothScanfilter, BluetoothScanfilterSequence, RequestDeviceoptions,
};
use bluetooth_traits::{BluetoothCharacteristicMsg, BluetoothDescriptorMsg, BluetoothServiceMsg};
use bluetooth_traits::{BluetoothDeviceMsg, BluetoothRequest, BluetoothResponse, GATTType};
use bluetooth_traits::{BluetoothError, BluetoothResponseResult, BluetoothResult};
use bluetooth_traits::blocklist::{uuid_is_blocklisted, Blocklist};
use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence, RequestDeviceoptions};
use device::bluetooth::{BluetoothAdapter, BluetoothDevice, BluetoothGATTCharacteristic};
use device::bluetooth::{BluetoothGATTDescriptor, BluetoothGATTService};
use embedder_traits::{EmbedderMsg, EmbedderProxy};
Expand Down
6 changes: 4 additions & 2 deletions components/bluetooth/test.rs
Expand Up @@ -4,10 +4,12 @@

use crate::BluetoothManager;
use device::bluetooth::{BluetoothAdapter, BluetoothDevice};
use device::bluetooth::{BluetoothGATTCharacteristic, BluetoothGATTDescriptor, BluetoothGATTService};
use device::bluetooth::{
BluetoothGATTCharacteristic, BluetoothGATTDescriptor, BluetoothGATTService,
};
use std::borrow::ToOwned;
use std::cell::RefCell;
use std::collections::{HashSet, HashMap};
use std::collections::{HashMap, HashSet};
use std::error::Error;
use std::string::String;
use uuid::Uuid;
Expand Down
8 changes: 5 additions & 3 deletions components/canvas/canvas_data.rs
Expand Up @@ -3,14 +3,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use azure::azure::AzFloat;
use azure::azure_hl::SurfacePattern;
use azure::azure_hl::{AntialiasMode, CapStyle, CompositionOp, JoinStyle};
use azure::azure_hl::{BackendType, DrawOptions, DrawTarget, Pattern, StrokeOptions, SurfaceFormat};
use azure::azure_hl::{
BackendType, DrawOptions, DrawTarget, Pattern, StrokeOptions, SurfaceFormat,
};
use azure::azure_hl::{Color, ColorPattern, DrawSurfaceOptions, Filter, PathBuilder};
use azure::azure_hl::{ExtendMode, GradientStop, LinearGradientPattern, RadialGradientPattern};
use azure::azure_hl::SurfacePattern;
use canvas_traits::canvas::*;
use cssparser::RGBA;
use euclid::{Transform2D, Point2D, Vector2D, Rect, Size2D};
use euclid::{Point2D, Rect, Size2D, Transform2D, Vector2D};
use ipc_channel::ipc::IpcSender;
use num_traits::ToPrimitive;
use pixels;
Expand Down
10 changes: 6 additions & 4 deletions components/canvas/gl_context.rs
Expand Up @@ -2,16 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use canvas_traits::webgl::{WebGLCommand, WebGLVersion, WebGLCommandBacktrace};
use compositing::compositor_thread::{CompositorProxy, self};
use super::webgl_thread::{GLState, WebGLImpl};
use canvas_traits::webgl::{WebGLCommand, WebGLCommandBacktrace, WebGLVersion};
use compositing::compositor_thread::{self, CompositorProxy};
use euclid::Size2D;
use gleam::gl;
use offscreen_gl_context::{ColorAttachmentType, GLContext, GLContextAttributes, GLContextDispatcher};
use offscreen_gl_context::{
ColorAttachmentType, GLContext, GLContextAttributes, GLContextDispatcher,
};
use offscreen_gl_context::{GLLimits, GLVersion};
use offscreen_gl_context::{NativeGLContext, NativeGLContextHandle, NativeGLContextMethods};
use offscreen_gl_context::{OSMesaContext, OSMesaContextHandle};
use std::sync::{Arc, Mutex};
use super::webgl_thread::{WebGLImpl, GLState};

/// The GLContextFactory is used to create shared GL contexts with the main thread GL context.
/// Currently, shared textures are used to render WebGL textures into the WR compositor.
Expand Down
4 changes: 2 additions & 2 deletions components/canvas/webgl_mode/inprocess.rs
Expand Up @@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use canvas_traits::webgl::webgl_channel;
use canvas_traits::webgl::DOMToTextureCommand;
use canvas_traits::webgl::{WebGLChan, WebGLContextId, WebGLMsg, WebGLPipeline, WebGLReceiver};
use canvas_traits::webgl::{WebGLSender, WebVRCommand, WebVRRenderHandler};
use canvas_traits::webgl::DOMToTextureCommand;
use canvas_traits::webgl::webgl_channel;
use crate::gl_context::GLContextFactory;
use crate::webgl_thread::{WebGLExternalImageApi, WebGLExternalImageHandler, WebGLThread};
use euclid::Size2D;
Expand Down
2 changes: 1 addition & 1 deletion components/canvas/webgl_thread.rs
Expand Up @@ -2,14 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use super::gl_context::{GLContextFactory, GLContextWrapper};
use canvas_traits::webgl::*;
use euclid::Size2D;
use fnv::FnvHashMap;
use gleam::gl;
use offscreen_gl_context::{GLContext, GLContextAttributes, GLLimits, NativeGLContextMethods};
use pixels;
use std::thread;
use super::gl_context::{GLContextFactory, GLContextWrapper};
use webrender;
use webrender_api;

Expand Down
2 changes: 1 addition & 1 deletion components/canvas_traits/canvas.rs
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use cssparser::RGBA;
use euclid::{Transform2D, Point2D, Rect, Size2D};
use euclid::{Point2D, Rect, Size2D, Transform2D};
use ipc_channel::ipc::{IpcBytesReceiver, IpcBytesSender, IpcSender};
use serde_bytes::ByteBuf;
use std::default::Default;
Expand Down
16 changes: 8 additions & 8 deletions components/canvas_traits/webgl.rs
Expand Up @@ -11,18 +11,18 @@ use std::borrow::Cow;
use std::num::NonZeroU32;
use webrender_api::{DocumentId, ImageKey, PipelineId};

/// Sender type used in WebGLCommands.
pub use crate::webgl_channel::WebGLSender;
/// Receiver type used in WebGLCommands.
pub use crate::webgl_channel::WebGLReceiver;
/// Result type for send()/recv() calls in in WebGLCommands.
pub use crate::webgl_channel::WebGLSendResult;
/// Helper function that creates a WebGL channel (WebGLSender, WebGLReceiver) to be used in WebGLCommands.
pub use crate::webgl_channel::webgl_channel;
/// Entry point type used in a Script Pipeline to get the WebGLChan to be used in that thread.
pub use crate::webgl_channel::WebGLPipeline;
/// Entry point channel type used for sending WebGLMsg messages to the WebGL renderer.
pub use crate::webgl_channel::WebGLChan;
/// Entry point type used in a Script Pipeline to get the WebGLChan to be used in that thread.
pub use crate::webgl_channel::WebGLPipeline;
/// Receiver type used in WebGLCommands.
pub use crate::webgl_channel::WebGLReceiver;
/// Result type for send()/recv() calls in in WebGLCommands.
pub use crate::webgl_channel::WebGLSendResult;
/// Sender type used in WebGLCommands.
pub use crate::webgl_channel::WebGLSender;

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct WebGLCommandBacktrace {
Expand Down
2 changes: 1 addition & 1 deletion components/channel/lib.rs
Expand Up @@ -15,8 +15,8 @@ pub use crossbeam_channel::*;
use ipc_channel::ipc::IpcReceiver;
use ipc_channel::router::ROUTER;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

pub fn route_ipc_receiver_to_new_servo_receiver<T>(ipc_receiver: IpcReceiver<T>) -> Receiver<T>
where
Expand Down
20 changes: 11 additions & 9 deletions components/compositing/compositor.rs
Expand Up @@ -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 http://mozilla.org/MPL/2.0/. */

use crate::CompositionPipeline;
use crate::SendableFrameTree;
use crate::compositor_thread::{CompositorProxy, CompositorReceiver};
use crate::compositor_thread::{InitialCompositorState, Msg};
#[cfg(feature = "gleam")]
use crate::gl;
use crate::touch::{TouchHandler, TouchAction};
use crate::windowing::{self, EmbedderCoordinates, MouseWindowEvent, WebRenderDebugOption, WindowMethods};
use euclid::{TypedPoint2D, TypedVector2D, TypedScale};
use crate::touch::{TouchAction, TouchHandler};
use crate::windowing::{
self, EmbedderCoordinates, MouseWindowEvent, WebRenderDebugOption, WindowMethods,
};
use crate::CompositionPipeline;
use crate::SendableFrameTree;
use euclid::{TypedPoint2D, TypedScale, TypedVector2D};
use gfx_traits::Epoch;
#[cfg(feature = "gleam")]
use image::{DynamicImage, ImageFormat};
Expand All @@ -20,23 +22,23 @@ use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
use net_traits::image::base::Image;
#[cfg(feature = "gleam")]
use net_traits::image::base::PixelFormat;
use profile_traits::time::{self as profile_time, ProfilerCategory, profile};
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEvent};
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
use script_traits::{MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId};
use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType};
use script_traits::CompositorEvent::{MouseMoveEvent, MouseButtonEvent, TouchEvent};
use servo_channel::Sender;
use servo_config::opts;
use servo_geometry::DeviceIndependentPixel;
use std::collections::HashMap;
use std::env;
use std::fs::{File, create_dir_all};
use std::fs::{create_dir_all, File};
use std::io::Write;
use std::num::NonZeroU32;
use std::rc::Rc;
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
use style_traits::cursor::CursorKind;
use style_traits::viewport::ViewportConstraints;
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
use time::{now, precise_time_ns, precise_time_s};
use webrender;
use webrender_api::{self, DeviceIntPoint, DevicePoint, HitTestFlags, HitTestResult};
Expand Down
2 changes: 1 addition & 1 deletion components/compositing/compositor_thread.rs
Expand Up @@ -4,8 +4,8 @@

//! Communication with the compositor thread.

use crate::SendableFrameTree;
use crate::compositor::CompositingReason;
use crate::SendableFrameTree;
use embedder_traits::EventLoopWaker;
use gfx_traits::Epoch;
use ipc_channel::ipc::IpcSender;
Expand Down
2 changes: 1 addition & 1 deletion components/compositing/lib.rs
Expand Up @@ -29,10 +29,10 @@ extern crate time;
extern crate webrender;
extern crate webrender_api;

pub use crate::compositor_thread::CompositorProxy;
pub use crate::compositor::IOCompositor;
pub use crate::compositor::RenderNotifier;
pub use crate::compositor::ShutdownState;
pub use crate::compositor_thread::CompositorProxy;
use euclid::TypedSize2D;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId;
Expand Down
4 changes: 2 additions & 2 deletions components/compositing/touch.rs
Expand Up @@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use euclid::{TypedPoint2D, TypedVector2D};
use self::TouchState::*;
use euclid::TypedScale;
use euclid::{TypedPoint2D, TypedVector2D};
use script_traits::{EventResult, TouchId};
use self::TouchState::*;
use style_traits::DevicePixel;

/// Minimum number of `DeviceIndependentPixel` to begin touch scrolling.
Expand Down
2 changes: 1 addition & 1 deletion components/compositing/windowing.rs
Expand Up @@ -17,7 +17,7 @@ use std::fmt::{Debug, Error, Formatter};
#[cfg(feature = "gleam")]
use std::rc::Rc;
use style_traits::DevicePixel;
use webrender_api::{DeviceIntPoint, DevicePoint, DeviceUintSize, DeviceUintRect, ScrollLocation};
use webrender_api::{DeviceIntPoint, DevicePoint, DeviceUintRect, DeviceUintSize, ScrollLocation};

#[derive(Clone)]
pub enum MouseWindowEvent {
Expand Down
2 changes: 1 addition & 1 deletion components/config/opts.rs
Expand Up @@ -19,7 +19,7 @@ use std::fs::{self, File};
use std::io::{self, Read, Write};
use std::path::{Path, PathBuf};
use std::process;
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
use url::{self, Url};

/// Global flags for Servo, currently set on the command line.
Expand Down
2 changes: 1 addition & 1 deletion components/config/prefs.rs
Expand Up @@ -11,7 +11,7 @@ use std::borrow::ToOwned;
use std::cmp::max;
use std::collections::HashMap;
use std::fs::File;
use std::io::{Read, Write, stderr};
use std::io::{stderr, Read, Write};
use std::path::PathBuf;
use std::sync::{Arc, RwLock};

Expand Down
2 changes: 1 addition & 1 deletion components/config/tests/opts.rs
Expand Up @@ -4,7 +4,7 @@

extern crate servo_config;

use servo_config::opts::{parse_url_or_filename, parse_pref_from_command_line};
use servo_config::opts::{parse_pref_from_command_line, parse_url_or_filename};
use servo_config::prefs::{PrefValue, PREFS};
use std::path::Path;

Expand Down
2 changes: 1 addition & 1 deletion components/config/tests/prefs.rs
Expand Up @@ -5,7 +5,7 @@
extern crate servo_config;

use servo_config::basedir;
use servo_config::prefs::{PREFS, PrefValue, read_prefs};
use servo_config::prefs::{read_prefs, PrefValue, PREFS};
use std::fs::{self, File};
use std::io::{Read, Write};

Expand Down
44 changes: 28 additions & 16 deletions components/constellation/constellation.rs
Expand Up @@ -96,49 +96,61 @@ use canvas::webgl_thread::WebGLThreads;
use canvas_traits::canvas::CanvasId;
use canvas_traits::canvas::CanvasMsg;
use clipboard::{ClipboardContext, ClipboardProvider};
use compositing::SendableFrameTree;
use compositing::compositor_thread::CompositorProxy;
use compositing::compositor_thread::Msg as ToCompositorMsg;
use crate::browsingcontext::{AllBrowsingContextsIterator, BrowsingContext, FullyActiveBrowsingContextsIterator};
use compositing::SendableFrameTree;
use crate::browsingcontext::NewBrowsingContextInfo;
use crate::browsingcontext::{
AllBrowsingContextsIterator, BrowsingContext, FullyActiveBrowsingContextsIterator,
};
use crate::event_loop::EventLoop;
use crate::network_listener::NetworkListener;
use crate::pipeline::{InitialPipelineState, Pipeline};
use crate::session_history::{JointSessionHistory, NeedsToReload, SessionHistoryChange, SessionHistoryDiff};
use crate::session_history::{
JointSessionHistory, NeedsToReload, SessionHistoryChange, SessionHistoryDiff,
};
use crate::timer_scheduler::TimerScheduler;
use debugger;
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
use embedder_traits::{EmbedderMsg, EmbedderProxy};
use euclid::{Size2D, TypedSize2D, TypedScale};
use euclid::{Size2D, TypedScale, TypedSize2D};
use gfx::font_cache_thread::FontCacheThread;
use gfx_traits::Epoch;
use ipc_channel::{Error as IpcError};
use ipc_channel::ipc::{self, IpcSender, IpcReceiver};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use ipc_channel::Error as IpcError;
use keyboard_types::KeyboardEvent;
use layout_traits::LayoutThreadFactory;
use log::{Log, Level, LevelFilter, Metadata, Record};
use msg::constellation_msg::{BrowsingContextId, PipelineId, HistoryStateId, TopLevelBrowsingContextId};
use log::{Level, LevelFilter, Log, Metadata, Record};
use msg::constellation_msg::{
BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId,
};
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
use net_traits::{self, IpcSend, FetchResponseMsg, ResourceThreads};
use net_traits::pub_domains::reg_host;
use net_traits::request::RequestInit;
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
use net_traits::{self, FetchResponseMsg, IpcSend, ResourceThreads};
use profile_traits::mem;
use profile_traits::time;
use script_traits::{AnimationState, AuxiliaryBrowsingContextLoadInfo, AnimationTickType, CompositorEvent};
use script_traits::{ConstellationControlMsg, ConstellationMsg as FromCompositorMsg, DiscardBrowsingContext};
use script_traits::{webdriver_msg, LogEntry, ScriptToConstellationChan, ServiceWorkerMsg};
use script_traits::{
AnimationState, AnimationTickType, AuxiliaryBrowsingContextLoadInfo, CompositorEvent,
};
use script_traits::{
ConstellationControlMsg, ConstellationMsg as FromCompositorMsg, DiscardBrowsingContext,
};
use script_traits::{DocumentActivity, DocumentState, LayoutControlMsg, LoadData};
use script_traits::{IFrameLoadInfo, IFrameLoadInfoWithData, IFrameSandboxState, TimerSchedulerMsg};
use script_traits::{
IFrameLoadInfo, IFrameLoadInfoWithData, IFrameSandboxState, TimerSchedulerMsg,
};
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
use script_traits::{LogEntry, ScriptToConstellationChan, ServiceWorkerMsg, webdriver_msg};
use script_traits::{SWManagerMsg, ScopeThings, UpdatePipelineIdReason, WebDriverCommandMsg};
use script_traits::{WindowSizeData, WindowSizeType};
use serde::{Deserialize, Serialize};
use servo_channel::{Receiver, Sender, channel};
use servo_channel::{channel, Receiver, Sender};
use servo_config::opts;
use servo_config::prefs::PREFS;
use servo_rand::{Rng, SeedableRng, ServoRng, random};
use servo_rand::{random, Rng, SeedableRng, ServoRng};
use servo_remutex::ReentrantMutex;
use servo_url::{Host, ImmutableOrigin, ServoUrl};
use std::borrow::ToOwned;
Expand All @@ -149,9 +161,9 @@ use std::process;
use std::rc::{Rc, Weak};
use std::sync::Arc;
use std::thread;
use style_traits::CSSPixel;
use style_traits::cursor::CursorKind;
use style_traits::viewport::ViewportConstraints;
use style_traits::CSSPixel;
use webrender_api;
use webvr_traits::{WebVREvent, WebVRMsg};

Expand Down

0 comments on commit 9e92eb2

Please sign in to comment.