fix(rustup): Remove uses of the obsolete &a[] syntax

This commit is contained in:
Renato Zannon
2015-02-21 03:31:32 -02:00
committed by Sean McArthur
parent 234fcdc3a2
commit 039e984f68
21 changed files with 47 additions and 47 deletions

View File

@@ -23,7 +23,7 @@ impl Header for SetCookie {
fn parse_header(raw: &[Vec<u8>]) -> Option<SetCookie> {
let mut set_cookies = Vec::with_capacity(raw.len());
for set_cookies_raw in raw.iter() {
match from_utf8(&set_cookies_raw[]) {
match from_utf8(&set_cookies_raw[..]) {
Ok(s) if !s.is_empty() => {
match s.parse() {
Ok(cookie) => set_cookies.push(cookie),
@@ -76,7 +76,7 @@ impl SetCookie {
#[test]
fn test_parse() {
let h = Header::parse_header(&[b"foo=bar; HttpOnly".to_vec()][]);
let h = Header::parse_header(&[b"foo=bar; HttpOnly".to_vec()][..]);
let mut c1 = Cookie::new("foo".to_string(), "bar".to_string());
c1.httponly = true;
@@ -94,7 +94,7 @@ fn test_fmt() {
let mut headers = Headers::new();
headers.set(cookies);
assert_eq!(&headers.to_string()[], "Set-Cookie: foo=bar; HttpOnly; Path=/p\r\nSet-Cookie: baz=quux; Path=/\r\n");
assert_eq!(&headers.to_string()[..], "Set-Cookie: foo=bar; HttpOnly; Path=/p\r\nSet-Cookie: baz=quux; Path=/\r\n");
}
#[test]