Skip to content

Commit 04e705d

Browse files
author
bors-servo
authored
Auto merge of #507 - est31:remove_rustc_serialize_feature, r=SimonSapin
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 -->
2 parents c1914b3 + ce34673 commit 04e705d

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ heapsize = {version = ">=0.4.1, <0.5", optional = true}
4747
idna = { version = "0.1.0", path = "./idna" }
4848
matches = "0.1"
4949
percent-encoding = { version = "1.0.0", path = "./percent_encoding" }
50-
rustc-serialize = {version = "0.3", optional = true}
5150
serde = {version = ">=0.6.1, <0.9", optional = true}
5251

5352
[[bench]]

src/lib.rs

-18
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ assert_eq!(css_url.as_str(), "http://servo.github.io/rust-url/main.css");
107107

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

110-
#[cfg(feature="rustc-serialize")] extern crate rustc_serialize;
111110
#[macro_use] extern crate matches;
112111
#[cfg(feature="serde")] extern crate serde;
113112
#[cfg(feature="heapsize")] #[macro_use] extern crate heapsize;
@@ -2226,23 +2225,6 @@ impl RangeArg for RangeTo<u32> {
22262225
}
22272226
}
22282227

2229-
#[cfg(feature="rustc-serialize")]
2230-
impl rustc_serialize::Encodable for Url {
2231-
fn encode<S: rustc_serialize::Encoder>(&self, encoder: &mut S) -> Result<(), S::Error> {
2232-
encoder.emit_str(self.as_str())
2233-
}
2234-
}
2235-
2236-
2237-
#[cfg(feature="rustc-serialize")]
2238-
impl rustc_serialize::Decodable for Url {
2239-
fn decode<D: rustc_serialize::Decoder>(decoder: &mut D) -> Result<Url, D::Error> {
2240-
Url::parse(&*decoder.read_str()?).map_err(|error| {
2241-
decoder.error(&format!("URL parsing error: {}", error))
2242-
})
2243-
}
2244-
}
2245-
22462228
/// Serializes this URL into a `serde` stream.
22472229
///
22482230
/// This implementation is only available if the `serde` Cargo feature is enabled.

0 commit comments

Comments
 (0)