- This is on top of:
- https://github.com/jeromefroe/lru-rs/pull/176
- Only the last commit is new code.
- I will rebase once #176 is merged.
get_or_insert, get_or_insert_mut and try_get_or_insert may return None only in the case where capacity is zero.
Instead this commit adds a ValueWrapper:
get_or_insert
,get_or_insert_mut
andtry_get_or_insert
may returnNone
only in the case where capacity is zero. Instead this commit adds aValueWrapper
:which makes it possible for these methods to always return a value which can be borrowed as V.