Skip to content

Commit 4de939b

Browse files
committed
Fix tests to build with current rust
1 parent 965590b commit 4de939b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ let issue_list_url = Url::parse(
5858
assert!(issue_list_url.scheme == "https".to_string());
5959
assert!(issue_list_url.domain() == Some("github.com"));
6060
assert!(issue_list_url.port() == None);
61-
assert!(issue_list_url.path() == Some(&["rust-lang".to_string(),
61+
assert!(issue_list_url.path() == Some(["rust-lang".to_string(),
6262
"rust".to_string(),
63-
"issues".to_string()]));
63+
"issues".to_string()].as_slice()));
6464
assert!(issue_list_url.query == Some("labels=E-easy&state=open".to_string()));
6565
assert!(issue_list_url.fragment == None);
6666
match issue_list_url.scheme_data {

src/tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn file_paths() {
210210

211211
let mut url = Url::from_file_path(&path::posix::Path::new("/foo/bar")).unwrap();
212212
assert_eq!(url.host(), Some(&Domain("".to_string())));
213-
assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string()]));
213+
assert_eq!(url.path(), Some(["foo".to_string(), "bar".to_string()].as_slice()));
214214
assert!(url.to_file_path() == Ok(path::posix::Path::new("/foo/bar")));
215215

216216
*url.path_mut().unwrap().get_mut(1) = "ba\0r".to_string();
@@ -226,7 +226,7 @@ fn file_paths() {
226226

227227
let mut url = Url::from_file_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
228228
assert_eq!(url.host(), Some(&Domain("".to_string())));
229-
assert_eq!(url.path(), Some(&["C:".to_string(), "foo".to_string(), "bar".to_string()]));
229+
assert_eq!(url.path(), Some(["C:".to_string(), "foo".to_string(), "bar".to_string()].as_slice()));
230230
assert!(url.to_file_path::<path::windows::Path>()
231231
== Ok(path::windows::Path::new(r"C:\foo\bar")));
232232

@@ -253,10 +253,10 @@ fn directory_paths() {
253253

254254
let url = Url::from_directory_path(&path::posix::Path::new("/foo/bar")).unwrap();
255255
assert_eq!(url.host(), Some(&Domain("".to_string())));
256-
assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string(), "".to_string()]));
256+
assert_eq!(url.path(), Some(["foo".to_string(), "bar".to_string(), "".to_string()].as_slice()));
257257

258258
let url = Url::from_directory_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
259259
assert_eq!(url.host(), Some(&Domain("".to_string())));
260-
assert_eq!(url.path(), Some(&[
261-
"C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()]));
260+
assert_eq!(url.path(), Some([
261+
"C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()].as_slice()));
262262
}

0 commit comments

Comments
 (0)