Просмотр исходного кода

Auto merge of #269 - frewsxcv:warnings, r=SimonSapin

Fix warnings.

<!-- 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/269)
<!-- Reviewable:end -->
bors-servo 9 лет назад
Родитель
Сommit
f7340cc2f0
2 измененных файлов с 5 добавлено и 4 удалено
  1. 1 1
      src/lib.rs
  2. 4 3
      tests/unit.rs

+ 1 - 1
src/lib.rs

@@ -126,7 +126,7 @@ use parser::{Parser, Context, SchemeType, to_u32};
 use percent_encoding::{PATH_SEGMENT_ENCODE_SET, USERINFO_ENCODE_SET,
 use percent_encoding::{PATH_SEGMENT_ENCODE_SET, USERINFO_ENCODE_SET,
                        percent_encode, percent_decode, utf8_percent_encode};
                        percent_encode, percent_decode, utf8_percent_encode};
 use std::cmp;
 use std::cmp;
-use std::error::Error;
+#[cfg(feature = "serde")] use std::error::Error;
 use std::fmt::{self, Write};
 use std::fmt::{self, Write};
 use std::hash;
 use std::hash;
 use std::io;
 use std::io;

+ 4 - 3
tests/unit.rs

@@ -123,14 +123,15 @@ fn issue_124() {
 
 
 #[test]
 #[test]
 fn test_equality() {
 fn test_equality() {
-    use std::hash::{Hash, Hasher, SipHasher};
+    use std::hash::{Hash, Hasher};
+    use std::collections::hash_map::DefaultHasher;
 
 
     fn check_eq(a: &Url, b: &Url) {
     fn check_eq(a: &Url, b: &Url) {
         assert_eq!(a, b);
         assert_eq!(a, b);
 
 
-        let mut h1 = SipHasher::new();
+        let mut h1 = DefaultHasher::new();
         a.hash(&mut h1);
         a.hash(&mut h1);
-        let mut h2 = SipHasher::new();
+        let mut h2 = DefaultHasher::new();
         b.hash(&mut h2);
         b.hash(&mut h2);
         assert_eq!(h1.finish(), h2.finish());
         assert_eq!(h1.finish(), h2.finish());
     }
     }