Skip to content

Commit

Permalink
Auto merge of #507 - est31:remove_rustc_serialize_feature, r=SimonSapin
Browse files Browse the repository at this point in the history
url crate: remove rustc-serialize optional dependency

Part of #506

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/507)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo authored Jul 13, 2019
2 parents c1914b3 + ce34673 commit 04e705d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ heapsize = {version = ">=0.4.1, <0.5", optional = true}
idna = { version = "0.1.0", path = "./idna" }
matches = "0.1"
percent-encoding = { version = "1.0.0", path = "./percent_encoding" }
rustc-serialize = {version = "0.3", optional = true}
serde = {version = ">=0.6.1, <0.9", optional = true}

[[bench]]
Expand Down
18 changes: 0 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ assert_eq!(css_url.as_str(), "http://servo.github.io/rust-url/main.css");

#![doc(html_root_url = "https://docs.rs/url/1.7.0")]

#[cfg(feature="rustc-serialize")] extern crate rustc_serialize;
#[macro_use] extern crate matches;
#[cfg(feature="serde")] extern crate serde;
#[cfg(feature="heapsize")] #[macro_use] extern crate heapsize;
Expand Down Expand Up @@ -2226,23 +2225,6 @@ impl RangeArg for RangeTo<u32> {
}
}

#[cfg(feature="rustc-serialize")]
impl rustc_serialize::Encodable for Url {
fn encode<S: rustc_serialize::Encoder>(&self, encoder: &mut S) -> Result<(), S::Error> {
encoder.emit_str(self.as_str())
}
}


#[cfg(feature="rustc-serialize")]
impl rustc_serialize::Decodable for Url {
fn decode<D: rustc_serialize::Decoder>(decoder: &mut D) -> Result<Url, D::Error> {
Url::parse(&*decoder.read_str()?).map_err(|error| {
decoder.error(&format!("URL parsing error: {}", error))
})
}
}

/// Serializes this URL into a `serde` stream.
///
/// This implementation is only available if the `serde` Cargo feature is enabled.
Expand Down

0 comments on commit 04e705d

Please sign in to comment.