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

Could cache_set return the insered element ? #39

Closed
Stargateur opened this issue Jun 29, 2020 · 3 comments · Fixed by #42
Closed

Could cache_set return the insered element ? #39

Stargateur opened this issue Jun 29, 2020 · 3 comments · Fixed by #42

Comments

@Stargateur
Copy link
Contributor

or even a tuple of the reference of the key and value.

I'm currently doing a set and a get doing two hash compute and find for something that could only take one step.

@jaemk
Copy link
Owner

jaemk commented Jul 2, 2020

I'd be open to adding a separate cache_set_return and cache_set_return_mut

@Stargateur
Copy link
Contributor Author

Stargateur commented Jul 2, 2020

cause set already borrow self as mut, there is no need for two method. also cache_set() should already return either the old value or the new one.

@Stargateur Stargateur mentioned this issue Jul 2, 2020
@jaemk jaemk closed this as completed in #42 Jul 3, 2020
@jaemk
Copy link
Owner

jaemk commented Jul 3, 2020

All of this should be out now in 0.15.0

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 a pull request may close this issue.

2 participants