mirror of https://github.com/rwf2/Rocket.git
Don't allocate a String into after parsing a cookie.
This commit is contained in:
parent
16cb7297ab
commit
4f8894f645
|
@ -34,8 +34,8 @@ impl<'a> Session<'a> {
|
|||
return None;
|
||||
}
|
||||
|
||||
let string = cookie_str[SESSION_PREFIX.len()..].to_string();
|
||||
Cookie::parse(string).ok()
|
||||
Cookie::parse(&cookie_str[SESSION_PREFIX.len()..]).ok()
|
||||
.map(|c| c.into_owned())
|
||||
}
|
||||
|
||||
pub fn get(&self, name: &str) -> Option<Cookie<'static>> {
|
||||
|
|
Loading…
Reference in New Issue