auto merge of #18645 : nick29581/rust/coercions-1, r=alexcrichton

r?

(I realise this needs a rebase, but I will probably have to chop it up in order to land and I'd like to get r+ first so I can do that quicker)
This commit is contained in:
bors
2014-11-18 10:46:41 +00:00
10 changed files with 37 additions and 72 deletions

View File

@@ -140,7 +140,7 @@ pub fn getcwd() -> Path {
panic!();
}
}
Path::new(String::from_utf16(::str::truncate_utf16_at_nul(buf))
Path::new(String::from_utf16(::str::truncate_utf16_at_nul(&buf))
.expect("GetCurrentDirectoryW returned invalid UTF-16"))
}
@@ -2065,12 +2065,12 @@ mod tests {
join_paths(input).unwrap().as_slice() == output.as_bytes()
}
assert!(test_eq([], ""));
assert!(test_eq([r"c:\windows", r"c:\"],
assert!(test_eq(&[], ""));
assert!(test_eq(&[r"c:\windows", r"c:\"],
r"c:\windows;c:\"));
assert!(test_eq(["", r"c:\windows", "", "", r"c:\", ""],
assert!(test_eq(&["", r"c:\windows", "", "", r"c:\", ""],
r";c:\windows;;;c:\;"));
assert!(test_eq([r"c:\te;st", r"c:\"],
assert!(test_eq(&[r"c:\te;st", r"c:\"],
r#""c:\te;st";c:\"#));
assert!(join_paths(&[r#"c:\te"st"#]).is_err());
}