Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix session mut borrow lifetime #87

Merged
merged 2 commits into from
Feb 28, 2018
Merged

Conversation

adwhit
Copy link
Contributor

@adwhit adwhit commented Feb 28, 2018

This fixes a lifetime issue where it is impossible to call session.set(...) more than once. e.g. calling

session.set("user_id", 1)?;
session.set("token", "1234")?;

throws an error

error[E0499]: cannot borrow `session` as mutable more than once at a time

I believe the problem is that the extra 'a in the signature ties the lifetime of the borrow to the lifetime of the Session object itself.

@fafhrd91
Copy link
Member

oh, thanks!

@fafhrd91
Copy link
Member

could you also add entry to CHANGES.md

@adwhit
Copy link
Contributor Author

adwhit commented Feb 28, 2018

Done. BTW thanks for your hard work, this is a great project

@codecov
Copy link

codecov bot commented Feb 28, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@171a235). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #87   +/-   ##
=========================================
  Coverage          ?   78.86%           
=========================================
  Files             ?       67           
  Lines             ?     8085           
  Branches          ?        0           
=========================================
  Hits              ?     6376           
  Misses            ?     1709           
  Partials          ?        0
Impacted Files Coverage Δ
src/middleware/session.rs 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 171a235...bb68f9d. Read the comment docs.

@fafhrd91
Copy link
Member

thanks for fix! the project getting bigger, I need all help I can get :)

@fafhrd91 fafhrd91 merged commit d977fe5 into actix:master Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants