update str::from_utf8

This commit is contained in:
Sean McArthur
2014-12-23 12:55:53 -08:00
parent 33f61213ce
commit 691c70a380
9 changed files with 20 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ impl Header for Cookies {
let mut cookies = Vec::with_capacity(raw.len());
for cookies_raw in raw.iter() {
match from_utf8(cookies_raw[]) {
Some(cookies_str) => {
Ok(cookies_str) => {
for cookie_str in cookies_str.split(';') {
match from_str(cookie_str.trim()) {
Some(cookie) => cookies.push(cookie),
@@ -35,7 +35,7 @@ impl Header for Cookies {
}
}
},
None => return None
Err(_) => return None
};
}