1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 18:44:35 +01: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(())
}