From 817172ebc4e656df804648c5657a4e391cb7b8ec Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 7 Apr 2017 17:50:16 +1000 Subject: [PATCH] Remove servo feature from servo_url --- components/compositing/Cargo.toml | 2 +- components/config/Cargo.toml | 2 +- components/constellation/Cargo.toml | 2 +- components/net_traits/Cargo.toml | 2 +- components/script/Cargo.toml | 2 +- components/script_traits/Cargo.toml | 2 +- components/style/Cargo.toml | 2 +- components/url/Cargo.toml | 17 +++++++---------- components/url/lib.rs | 16 ++++++---------- components/url/origin.rs | 13 ++++--------- components/webdriver_server/Cargo.toml | 2 +- 11 files changed, 25 insertions(+), 37 deletions(-) diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index 9f2b6dea489..ba7999629e4 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -22,7 +22,7 @@ profile_traits = {path = "../profile_traits"} script_traits = {path = "../script_traits"} servo_config = {path = "../config"} servo_geometry = {path = "../geometry", features = ["servo"]} -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} style_traits = {path = "../style_traits"} time = "0.1.17" webrender = {git = "https://github.com/servo/webrender"} diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index b71dca3b548..4af91cab66c 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -19,7 +19,7 @@ rustc-serialize = "0.3" serde = {version = "0.9"} serde_derive = {version = "0.9"} servo_geometry = {path = "../geometry"} -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} url = "1.2" [dev-dependencies] diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml index 5ea316ed475..e6b8bfebeb3 100644 --- a/components/constellation/Cargo.toml +++ b/components/constellation/Cargo.toml @@ -36,7 +36,7 @@ style_traits = {path = "../style_traits"} servo_config = {path = "../config"} servo_rand = {path = "../rand"} servo_remutex = {path = "../remutex"} -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} webvr_traits = {path = "../webvr_traits"} webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/components/net_traits/Cargo.toml b/components/net_traits/Cargo.toml index fefe98482fe..7af5b9159dc 100644 --- a/components/net_traits/Cargo.toml +++ b/components/net_traits/Cargo.toml @@ -25,7 +25,7 @@ num-traits = "0.1.32" serde = "0.9" serde_derive = "0.9" servo_config = {path = "../config"} -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} url = {version = "1.2", features = ["heap_size"]} uuid = {version = "0.4", features = ["v4", "serde"]} webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 5c9863f8aef..a1c963b1d64 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -80,7 +80,7 @@ servo_atoms = {path = "../atoms"} servo_config = {path = "../config"} servo_geometry = {path = "../geometry" } servo_rand = {path = "../rand"} -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} smallvec = "0.3" style = {path = "../style"} style_traits = {path = "../style_traits"} diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml index 53a57c28c27..c3332046117 100644 --- a/components/script_traits/Cargo.toml +++ b/components/script_traits/Cargo.toml @@ -30,7 +30,7 @@ profile_traits = {path = "../profile_traits"} rustc-serialize = "0.3.4" serde = "0.9" serde_derive = "0.9" -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} style_traits = {path = "../style_traits", features = ["servo"]} time = "0.1.12" url = {version = "1.2", features = ["heap_size"]} diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 04cb51df3c6..5ccebb0e70f 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -18,7 +18,7 @@ use_bindgen = ["bindgen", "regex"] servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive", "style_traits/servo", "servo_atoms", "servo_config", "html5ever-atoms", "cssparser/heapsize", "cssparser/serde", "encoding", - "rayon/unstable", "servo_url", "servo_url/servo"] + "rayon/unstable", "servo_url"] testing = [] [dependencies] diff --git a/components/url/Cargo.toml b/components/url/Cargo.toml index 4cefa0611c6..9b2a5c0d5e2 100644 --- a/components/url/Cargo.toml +++ b/components/url/Cargo.toml @@ -9,15 +9,12 @@ publish = false name = "servo_url" path = "lib.rs" -[features] -servo = ["heapsize", "heapsize_derive", "serde", "serde_derive", "uuid/serde", "url/heap_size", "url_serde"] - [dependencies] -heapsize = {version = "0.3.0", optional = true} -heapsize_derive = {version = "0.1", optional = true} -serde = {version = "0.9", optional = true} -serde_derive = {version = "0.9", optional = true} +heapsize = {version = "0.3.0"} +heapsize_derive = {version = "0.1"} +serde = {version = "0.9"} +serde_derive = {version = "0.9"} servo_rand = {path = "../rand"} -url = "1.2" -url_serde = {version = "0.1.3", optional = true} -uuid = {version = "0.4.0", features = ["v4"]} +url = {version = "1.2", features = ["heap_size"]} +url_serde = {version = "0.1.3"} +uuid = {version = "0.4.0", features = ["v4", "serde"]} diff --git a/components/url/lib.rs b/components/url/lib.rs index 3ed02fae11d..d3ae836bb74 100644 --- a/components/url/lib.rs +++ b/components/url/lib.rs @@ -7,14 +7,13 @@ #![crate_name = "servo_url"] #![crate_type = "rlib"] -#[cfg(feature = "servo")] #[macro_use] extern crate heapsize; -#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; -#[cfg(feature = "servo")] extern crate serde; -#[cfg(feature = "servo")] #[macro_use] extern crate serde_derive; -#[cfg(feature = "servo")] extern crate url_serde; - +#[macro_use] extern crate heapsize; +#[macro_use] extern crate heapsize_derive; +extern crate serde; +#[macro_use] extern crate serde_derive; extern crate servo_rand; extern crate url; +extern crate url_serde; extern crate uuid; pub mod origin; @@ -30,8 +29,7 @@ use url::{Url, Position}; pub use url::Host; -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HeapSizeOf)] pub struct ServoUrl(Arc); impl ServoUrl { @@ -203,7 +201,6 @@ impl From for ServoUrl { } } -#[cfg(feature = "servo")] impl serde::Serialize for ServoUrl { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -212,7 +209,6 @@ impl serde::Serialize for ServoUrl { } } -#[cfg(feature = "servo")] impl serde::Deserialize for ServoUrl { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer, diff --git a/components/url/origin.rs b/components/url/origin.rs index 3795b73fb61..faf30b13288 100644 --- a/components/url/origin.rs +++ b/components/url/origin.rs @@ -7,12 +7,11 @@ use servo_rand::Rng; use std::cell::RefCell; use std::rc::Rc; use url::{Host, Origin}; -#[cfg(feature = "servo")] use url_serde; +use url_serde; use uuid::Uuid; /// The origin of an URL -#[derive(PartialEq, Eq, Clone, Debug)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] +#[derive(PartialEq, Eq, Clone, Debug, HeapSizeOf, Deserialize, Serialize)] pub enum ImmutableOrigin { /// A globally unique identifier Opaque(OpaqueOrigin), @@ -20,8 +19,7 @@ pub enum ImmutableOrigin { /// Consists of the URL's scheme, host and port Tuple( String, - #[cfg_attr(feature = "servo", - serde(deserialize_with = "url_serde::deserialize", serialize_with = "url_serde::serialize"))] + #[serde(deserialize_with = "url_serde::deserialize", serialize_with = "url_serde::serialize")] Host, u16, ) @@ -97,18 +95,15 @@ impl ImmutableOrigin { } /// Opaque identifier for URLs that have file or other schemes -#[derive(Eq, PartialEq, Clone, Debug)] -#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] +#[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize)] pub struct OpaqueOrigin(Uuid); -#[cfg(feature = "servo")] known_heap_size!(0, OpaqueOrigin); /// A representation of an [origin](https://html.spec.whatwg.org/multipage/#origin-2). #[derive(Clone, Debug)] pub struct MutableOrigin(Rc<(ImmutableOrigin, RefCell>)>); -#[cfg(feature = "servo")] known_heap_size!(0, MutableOrigin); impl MutableOrigin { diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml index edc5e8025bb..13647ef703d 100644 --- a/components/webdriver_server/Cargo.toml +++ b/components/webdriver_server/Cargo.toml @@ -23,7 +23,7 @@ regex = "0.2" rustc-serialize = "0.3.4" script_traits = {path = "../script_traits"} servo_config = {path = "../config"} -servo_url = {path = "../url", features = ["servo"]} +servo_url = {path = "../url"} url = {version = "1.2", features = ["heap_size"]} uuid = {version = "0.4", features = ["v4"]} webdriver = "0.22"