diff options
Diffstat (limited to 'components/url/lib.rs')
-rw-r--r-- | components/url/lib.rs | 20 |
1 files changed, 1 insertions, 19 deletions
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) - } -} |