diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2019-07-16 15:10:21 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2019-08-17 10:03:44 +0200 |
commit | 939218000784d5909ddb4808015a370d7e47b0d4 (patch) | |
tree | aabb02b7766bc71a68109c92e75aa9573708f87c /components/url | |
parent | ff3f3d30c741eb8d73d6a39421cbfc7451ec97ee (diff) | |
download | servo-939218000784d5909ddb4808015a370d7e47b0d4.tar.gz servo-939218000784d5909ddb4808015a370d7e47b0d4.zip |
Update to url 2.0
Diffstat (limited to 'components/url')
-rw-r--r-- | components/url/Cargo.toml | 3 | ||||
-rw-r--r-- | components/url/lib.rs | 20 | ||||
-rw-r--r-- | components/url/origin.rs | 10 |
3 files changed, 3 insertions, 30 deletions
diff --git a/components/url/Cargo.toml b/components/url/Cargo.toml index 1a59812e071..d766316cd1f 100644 --- a/components/url/Cargo.toml +++ b/components/url/Cargo.toml @@ -17,6 +17,5 @@ to_shmem = { path = "../to_shmem" } to_shmem_derive = { path = "../to_shmem_derive" } serde = {version = "1.0", features = ["derive"]} servo_rand = {path = "../rand"} -url = "1.2" -url_serde = {version = "0.2"} +url = {version = "2.0", features = ["serde"]} uuid = {version = "0.7", features = ["v4", "serde"]} diff --git a/components/url/lib.rs b/components/url/lib.rs index bb7c1fa4e35..1c27c069ae6 100644 --- a/components/url/lib.rs +++ b/components/url/lib.rs @@ -30,7 +30,7 @@ use url::{Position, Url}; pub use url::Host; -#[derive(Clone, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd)] +#[derive(Clone, Deserialize, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd, Serialize)] pub struct ServoUrl(#[ignore_malloc_size_of = "Arc"] Arc<Url>); impl ToShmem for ServoUrl { @@ -222,21 +222,3 @@ impl From<Url> for ServoUrl { ServoUrl::from_url(url) } } - -impl serde::Serialize for ServoUrl { - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> - where - S: serde::Serializer, - { - url_serde::serialize(&*self.0, serializer) - } -} - -impl<'de> serde::Deserialize<'de> for ServoUrl { - fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> - where - D: serde::Deserializer<'de>, - { - url_serde::deserialize(deserializer).map(Self::from_url) - } -} diff --git a/components/url/origin.rs b/components/url/origin.rs index c0174c38e1f..1878e85a9d8 100644 --- a/components/url/origin.rs +++ b/components/url/origin.rs @@ -14,15 +14,7 @@ pub enum ImmutableOrigin { Opaque(OpaqueOrigin), /// Consists of the URL's scheme, host and port - Tuple( - String, - #[serde( - deserialize_with = "url_serde::deserialize", - serialize_with = "url_serde::serialize" - )] - Host, - u16, - ), + Tuple(String, Host, u16), } impl ImmutableOrigin { |