Strict import formatting (grouping and granularity) (#30325)

* strict imports formatting

* Reformat all imports
This commit is contained in:
Samson 2023-09-11 21:16:54 +02:00 committed by GitHub
parent 413da4ca69
commit aad2dccc9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
802 changed files with 6861 additions and 6395 deletions

View file

@ -2,6 +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 std::fmt;
use std::result::Result;
use msg::constellation_msg::PipelineId;
use servo_atoms::Atom;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::refcounted::Trusted;
use crate::dom::event::{EventBubbles, EventCancelable, EventTask, SimpleEventTask};
@ -10,10 +16,6 @@ use crate::dom::window::Window;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
use servo_atoms::Atom;
use std::fmt;
use std::result::Result;
#[derive(JSTraceable)]
pub struct DOMManipulationTaskSource(pub Box<dyn ScriptChan + Send>, #[no_trace] pub PipelineId);

View file

@ -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 msg::constellation_msg::PipelineId;
use crate::dom::domexception::DOMErrorName;
use crate::dom::filereader::{FileReader, GenerationId, ReadMetaData, TrustedFileReader};
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
#[derive(JSTraceable)]
pub struct FileReadingTaskSource(

View file

@ -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 crossbeam_channel::Sender;
use msg::constellation_msg::PipelineId;
use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
use crate::script_thread::MainThreadScriptMsg;
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use crossbeam_channel::Sender;
use msg::constellation_msg::PipelineId;
#[derive(Clone, JSTraceable)]
pub struct HistoryTraversalTaskSource(

View file

@ -2,6 +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 std::fmt;
use std::result::Result;
use crossbeam_channel::Sender;
use msg::constellation_msg::PipelineId;
use servo_atoms::Atom;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::refcounted::Trusted;
use crate::dom::event::SimpleEventTask;
@ -11,11 +18,6 @@ use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
use crate::script_thread::MainThreadScriptMsg;
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use crossbeam_channel::Sender;
use msg::constellation_msg::PipelineId;
use servo_atoms::Atom;
use std::fmt;
use std::result::Result;
#[derive(Clone, JSTraceable)]
pub struct MediaElementTaskSource(

View file

@ -14,10 +14,12 @@ pub mod timer;
pub mod user_interaction;
pub mod websocket;
use std::result::Result;
use enum_iterator::IntoEnumIterator;
use crate::dom::globalscope::GlobalScope;
use crate::task::{TaskCanceller, TaskOnce};
use enum_iterator::IntoEnumIterator;
use std::result::Result;
// The names of all task sources, used to differentiate TaskCancellers.
// Note: When adding a task source, update this enum.

View file

@ -2,10 +2,11 @@
* 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 msg::constellation_msg::PipelineId;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
#[derive(JSTraceable)]
pub struct NetworkingTaskSource(

View file

@ -6,14 +6,16 @@
// a low priority task and it should be processed during idle periods.
// We are currently treating this task queue as a normal priority queue.
use std::fmt;
use std::result::Result;
use msg::constellation_msg::PipelineId;
use crate::dom::bindings::refcounted::Trusted;
use crate::dom::globalscope::GlobalScope;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
use std::fmt;
use std::result::Result;
#[derive(JSTraceable)]
pub struct PerformanceTimelineTaskSource(

View file

@ -2,11 +2,13 @@
* 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 std::fmt;
use msg::constellation_msg::PipelineId;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
use std::fmt;
#[derive(JSTraceable)]
pub struct PortMessageQueue(

View file

@ -2,10 +2,11 @@
* 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 msg::constellation_msg::PipelineId;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
#[derive(JSTraceable)]
pub struct RemoteEventTaskSource(

View file

@ -2,11 +2,13 @@
* 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 std::fmt;
use msg::constellation_msg::PipelineId;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
use std::fmt;
#[derive(JSTraceable)]
/// https://html.spec.whatwg.org/multipage/#timer-task-source

View file

@ -2,6 +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 std::fmt;
use std::result::Result;
use crossbeam_channel::Sender;
use msg::constellation_msg::PipelineId;
use servo_atoms::Atom;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::refcounted::Trusted;
use crate::dom::event::{EventBubbles, EventCancelable, EventTask};
@ -11,11 +18,6 @@ use crate::script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
use crate::script_thread::MainThreadScriptMsg;
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use crossbeam_channel::Sender;
use msg::constellation_msg::PipelineId;
use servo_atoms::Atom;
use std::fmt;
use std::result::Result;
#[derive(Clone, JSTraceable)]
pub struct UserInteractionTaskSource(

View file

@ -2,10 +2,11 @@
* 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 msg::constellation_msg::PipelineId;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use crate::task::{TaskCanceller, TaskOnce};
use crate::task_source::{TaskSource, TaskSourceName};
use msg::constellation_msg::PipelineId;
#[derive(JSTraceable)]
pub struct WebsocketTaskSource(