1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 16:02:59 +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 # Changes
## 0.4.1 (2018-03-xx)
* Fix Session mutable borrow lifetime
## 0.4.0 (2018-02-28) ## 0.4.0 (2018-02-28)
* Actix 0.5 compatibility * Actix 0.5 compatibility

View File

@ -86,7 +86,7 @@ impl<'a> Session<'a> {
} }
/// Set a `value` from the session. /// 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)?); self.0.set(key, serde_json::to_string(&value)?);
Ok(()) Ok(())
} }