소스 검색

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 -->
bors-servo 7 년 전
부모
커밋
04e705d476
2개의 변경된 파일0개의 추가작업 그리고 19개의 파일을 삭제
  1. 0 1
      Cargo.toml
  2. 0 18
      src/lib.rs

+ 0 - 1
Cargo.toml

@@ -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]]

+ 0 - 18
src/lib.rs

@@ -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;
@@ -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.