refactor(hyper): Fix a few nits

This commit is contained in:
Pyfisch
2015-05-01 11:57:25 +02:00
parent 92ee51acdb
commit 6b59bd28b7
8 changed files with 18 additions and 34 deletions

View File

@@ -22,16 +22,12 @@ 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[..]) {
Ok(s) if !s.is_empty() => {
match s.parse() {
Ok(cookie) => set_cookies.push(cookie),
Err(_) => ()
}
},
_ => ()
};
for set_cookies_raw in raw {
if let Ok(s) = from_utf8(&set_cookies_raw[..]) {
if let Ok(cookie) = s.parse() {
set_cookies.push(cookie);
}
}
}
if !set_cookies.is_empty() {