From 5dd4529165ea8a6b76f71d3f18a231fef80f18c9 Mon Sep 17 00:00:00 2001 From: Michael Kovalchik Date: Thu, 1 Jan 2015 19:51:14 -0500 Subject: [PATCH] Use renamed unsafe_get and concat_vec methods. Changed calls to unsafe_get to use get_unchecked and calls to concat_vec to use concat to avoid deprecation lints. --- src/header/common/authorization.rs | 2 +- src/header/common/cache_control.rs | 2 +- src/header/common/util.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/header/common/authorization.rs b/src/header/common/authorization.rs index 0b953f8f3c..0b69d4d441 100644 --- a/src/header/common/authorization.rs +++ b/src/header/common/authorization.rs @@ -26,7 +26,7 @@ impl Header for Authorization { fn parse_header(raw: &[Vec]) -> Option> { if raw.len() == 1 { - match (from_utf8(unsafe { raw[].unsafe_get(0)[] }), Scheme::scheme(None::)) { + match (from_utf8(unsafe { raw[].get_unchecked(0)[] }), Scheme::scheme(None::)) { (Ok(header), Some(scheme)) if header.starts_with(scheme) && header.len() > scheme.len() + 1 => { header[scheme.len() + 1..].parse::().map(|s| Authorization(s)) diff --git a/src/header/common/cache_control.rs b/src/header/common/cache_control.rs index 74df42a1bc..304c01dbf6 100644 --- a/src/header/common/cache_control.rs +++ b/src/header/common/cache_control.rs @@ -18,7 +18,7 @@ impl Header for CacheControl { let directives = raw.iter() .filter_map(|line| from_one_comma_delimited(line[])) .collect::>>() - .concat_vec(); + .concat(); if directives.len() > 0 { Some(CacheControl(directives)) } else { diff --git a/src/header/common/util.rs b/src/header/common/util.rs index 5b1889ebf6..f5185592ca 100644 --- a/src/header/common/util.rs +++ b/src/header/common/util.rs @@ -10,7 +10,7 @@ pub fn from_one_raw_str(raw: &[Vec]) -> Option { return None; } // we JUST checked that raw.len() == 1, so raw[0] WILL exist. - match from_utf8(unsafe { raw[].unsafe_get(0)[] }) { + match from_utf8(unsafe { raw[].get_unchecked(0)[] }) { Ok(s) => FromStr::from_str(s), Err(_) => None } @@ -23,7 +23,7 @@ pub fn from_comma_delimited(raw: &[Vec]) -> Option> { return None; } // we JUST checked that raw.len() == 1, so raw[0] WILL exist. - from_one_comma_delimited(unsafe { raw.as_slice().unsafe_get(0).as_slice() }) + from_one_comma_delimited(unsafe { raw.as_slice().get_unchecked(0).as_slice() }) } /// Reads a comma-delimited raw string into a Vec.