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,13 +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 crate::filemanager_thread::FileOrigin;
use std::str::FromStr;
use serde::{Deserialize, Serialize};
use servo_url::ServoUrl;
use std::str::FromStr;
use url::Url;
use uuid::Uuid;
use crate::filemanager_thread::FileOrigin;
/// Errors returned to Blob URL Store request
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub enum BlobURLStoreError {

View file

@ -2,17 +2,19 @@
* 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 crate::blob_url_store::{BlobBuf, BlobURLStoreError};
use std::cmp::{max, min};
use std::ops::Range;
use std::path::PathBuf;
use embedder_traits::FilterPattern;
use ipc_channel::ipc::IpcSender;
use malloc_size_of_derive::MallocSizeOf;
use num_traits::ToPrimitive;
use serde::{Deserialize, Serialize};
use std::cmp::{max, min};
use std::ops::Range;
use std::path::PathBuf;
use uuid::Uuid;
use crate::blob_url_store::{BlobBuf, BlobURLStoreError};
// HACK: Not really process-safe now, we should send Origin
// directly instead of this in future, blocked on #11722
/// File manager store entry's origin

View file

@ -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 https://mozilla.org/MPL/2.0/. */
use crate::image_cache::CorsStatus;
use std::fmt;
use image::ImageFormat;
use ipc_channel::ipc::IpcSharedMemory;
use log::debug;
use malloc_size_of_derive::MallocSizeOf;
use pixels::PixelFormat;
use serde::{Deserialize, Serialize};
use std::fmt;
use webrender_api::ImageKey;
use crate::image_cache::CorsStatus;
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct Image {
pub width: u32,

View file

@ -2,16 +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 crate::image::base::{Image, ImageMetadata};
use crate::request::CorsSettings;
use crate::FetchResponseMsg;
use crate::WebrenderIpcSender;
use std::sync::Arc;
use ipc_channel::ipc::IpcSender;
use log::debug;
use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
use servo_url::{ImmutableOrigin, ServoUrl};
use std::sync::Arc;
use crate::image::base::{Image, ImageMetadata};
use crate::request::CorsSettings;
use crate::{FetchResponseMsg, WebrenderIpcSender};
// ======================================================================
// Aux structs and enums.

View file

@ -4,14 +4,9 @@
#![deny(unsafe_code)]
use crate::filemanager_thread::FileManagerThreadMsg;
use crate::request::{Request, RequestBuilder};
use crate::response::{HttpsState, Response, ResponseInit};
use crate::storage_thread::StorageThreadMsg;
use cookie::Cookie;
use headers::{ContentType, HeaderMapExt, ReferrerPolicy as ReferrerPolicyHeader};
use http::StatusCode;
use http::{Error as HttpError, HeaderMap};
use http::{Error as HttpError, HeaderMap, StatusCode};
use hyper::Error as HyperError;
use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
@ -30,6 +25,11 @@ use servo_url::{ImmutableOrigin, ServoUrl};
use time::precise_time_ns;
use webrender_api::{ImageData, ImageDescriptor, ImageKey};
use crate::filemanager_thread::FileManagerThreadMsg;
use crate::request::{Request, RequestBuilder};
use crate::response::{HttpsState, Response, ResponseInit};
use crate::storage_thread::StorageThreadMsg;
pub mod blob_url_store;
pub mod filemanager_thread;
pub mod image_cache;

View file

@ -14,11 +14,12 @@
//! we don't need to make the code more complex for it. The `mach` update command makes sure that
//! those cases are not present.
use std::collections::HashSet;
use std::iter::FromIterator;
use embedder_traits::resources::{self, Resource};
use lazy_static::lazy_static;
use servo_url::{Host, ImmutableOrigin, ServoUrl};
use std::collections::HashSet;
use std::iter::FromIterator;
#[derive(Clone, Debug)]
pub struct PubDomainRules {

View file

@ -6,9 +6,10 @@
// This is copy pasted from the old hyper headers to avoid hardcoding everything
// (I would probably also make some silly mistakes while migrating...)
use std::{fmt, str};
use http::header::HeaderValue;
use mime::Mime;
use std::{fmt, str};
/// A quality value, as specified in [RFC7231].
///

View file

@ -2,21 +2,20 @@
* 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 crate::response::HttpsState;
use crate::ReferrerPolicy;
use crate::ResourceTimingType;
use std::sync::{Arc, Mutex};
use content_security_policy::{self as csp, CspList};
use http::header::{HeaderName, AUTHORIZATION};
use http::HeaderMap;
use http::Method;
use http::{HeaderMap, Method};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use malloc_size_of_derive::MallocSizeOf;
use mime::Mime;
use msg::constellation_msg::PipelineId;
use serde::Deserialize;
use serde::Serialize;
use serde::{Deserialize, Serialize};
use servo_url::{ImmutableOrigin, ServoUrl};
use std::sync::{Arc, Mutex};
use crate::response::HttpsState;
use crate::{ReferrerPolicy, ResourceTimingType};
/// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
#[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]

View file

@ -4,8 +4,9 @@
//! The [Response](https://fetch.spec.whatwg.org/#responses) object
//! resulting from a [fetch operation](https://fetch.spec.whatwg.org/#concept-fetch)
use crate::{FetchMetadata, FilteredMetadata, Metadata, NetworkError, ReferrerPolicy};
use crate::{ResourceFetchTiming, ResourceTimingType};
use std::sync::atomic::AtomicBool;
use std::sync::Mutex;
use headers::{ContentType, HeaderMapExt};
use http::{HeaderMap, StatusCode};
use hyper_serde::Serde;
@ -13,8 +14,11 @@ use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
use servo_arc::Arc;
use servo_url::ServoUrl;
use std::sync::atomic::AtomicBool;
use std::sync::Mutex;
use crate::{
FetchMetadata, FilteredMetadata, Metadata, NetworkError, ReferrerPolicy, ResourceFetchTiming,
ResourceTimingType,
};
/// [Response type](https://fetch.spec.whatwg.org/#concept-response-type)
#[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]