Răsfoiți Sursa

Fix tests to build with current rust

Björn Steinbrink 12 ani în urmă
părinte
comite
4de939b0c6
2 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 2 2
      src/lib.rs
  2. 5 5
      src/tests.rs

+ 2 - 2
src/lib.rs

@@ -58,9 +58,9 @@ let issue_list_url = Url::parse(
 assert!(issue_list_url.scheme == "https".to_string());
 assert!(issue_list_url.domain() == Some("github.com"));
 assert!(issue_list_url.port() == None);
-assert!(issue_list_url.path() == Some(&["rust-lang".to_string(),
+assert!(issue_list_url.path() == Some(["rust-lang".to_string(),
                                         "rust".to_string(),
-                                        "issues".to_string()]));
+                                        "issues".to_string()].as_slice()));
 assert!(issue_list_url.query == Some("labels=E-easy&state=open".to_string()));
 assert!(issue_list_url.fragment == None);
 match issue_list_url.scheme_data {

+ 5 - 5
src/tests.rs

@@ -210,7 +210,7 @@ fn file_paths() {
 
     let mut url = Url::from_file_path(&path::posix::Path::new("/foo/bar")).unwrap();
     assert_eq!(url.host(), Some(&Domain("".to_string())));
-    assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string()]));
+    assert_eq!(url.path(), Some(["foo".to_string(), "bar".to_string()].as_slice()));
     assert!(url.to_file_path() == Ok(path::posix::Path::new("/foo/bar")));
 
     *url.path_mut().unwrap().get_mut(1) = "ba\0r".to_string();
@@ -226,7 +226,7 @@ fn file_paths() {
 
     let mut url = Url::from_file_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
     assert_eq!(url.host(), Some(&Domain("".to_string())));
-    assert_eq!(url.path(), Some(&["C:".to_string(), "foo".to_string(), "bar".to_string()]));
+    assert_eq!(url.path(), Some(["C:".to_string(), "foo".to_string(), "bar".to_string()].as_slice()));
     assert!(url.to_file_path::<path::windows::Path>()
             == Ok(path::windows::Path::new(r"C:\foo\bar")));
 
@@ -253,10 +253,10 @@ fn directory_paths() {
 
     let url = Url::from_directory_path(&path::posix::Path::new("/foo/bar")).unwrap();
     assert_eq!(url.host(), Some(&Domain("".to_string())));
-    assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string(), "".to_string()]));
+    assert_eq!(url.path(), Some(["foo".to_string(), "bar".to_string(), "".to_string()].as_slice()));
 
     let url = Url::from_directory_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
     assert_eq!(url.host(), Some(&Domain("".to_string())));
-    assert_eq!(url.path(), Some(&[
-        "C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()]));
+    assert_eq!(url.path(), Some([
+        "C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()].as_slice()));
 }