1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-10-22 01:44:20 +00:00

Merge pull request #87 from adwhit/fix-session-set

fix session mut borrow lifetime
This commit is contained in:
Nikolay Kim 2018-02-28 12:34:46 -08:00 committed by GitHub
commit d977fe563b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,10 @@
# Changes
## 0.4.1 (2018-03-xx)
* Fix Session mutable borrow lifetime
## 0.4.0 (2018-02-28)
* Actix 0.5 compatibility

View file

@ -86,7 +86,7 @@ impl<'a> Session<'a> {
}
/// Set a `value` from the session.
pub fn set<T: Serialize>(&'a mut self, key: &str, value: T) -> Result<()> {
pub fn set<T: Serialize>(&mut self, key: &str, value: T) -> Result<()> {
self.0.set(key, serde_json::to_string(&value)?);
Ok(())
}