mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update to url 2.0
This commit is contained in:
parent
ff3f3d30c7
commit
9392180007
26 changed files with 74 additions and 355 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue