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

merge the original repo updates #3

Open
wants to merge 112 commits into
base: master
Choose a base branch
from

Conversation

yuhao-su
Copy link

No description provided.

peamaeq and others added 30 commits May 18, 2022 12:26
Adjust unsafe blocks for the Drop impl
Replace Travis CI with GitHub Actions
replace usize with NonZeroUsize for LRU's capacity
jeromefroe and others added 30 commits November 21, 2023 20:33
chore: fix build status badge in README
…t-clone

feat: implement Clone for LruCache
…ecursion-lints

Ignore unconditional recursion lints
Remove needless lifetimes (clippy warnings)
Four new methods are added:
* get_or_insert_ref
* try_get_or_insert_ref
* get_or_insert_mut_ref
* try_get_or_insert_mut_ref

which are analog to their existing counterparts:
* get_or_insert
* try_get_or_insert
* get_or_insert_mut
* try_get_or_insert_mut

with the difference of accepting a reference to the key instead of an owned object. If the key
doesn't exist in the cache and needs to be moved, only then is it cloned using to_owned() so it can
be owned by the cache. This is useful when cloning the key is expensive.
Create a version of get_or_insert that doesn't move the key
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.