schnellru icon indicating copy to clipboard operation
schnellru copied to clipboard

feature: implement get() and get_mut()

Open happybeing opened this issue 11 months ago • 1 comments

LruMap currently implements get() which returns a mutable reference and no way I can see to get a non-mutable reference. I'm trying to use it with RwLock which doesn't work for read() because it requires a non-mutable get().

Is there a way to do this, and if not do you think this could be implemented?

happybeing avatar Jan 13 '25 13:01 happybeing

While there may be some merit in the suggestion (or not!), I have realised this is not the issue for my use case because it is the cache that RwLock wants an immutable ref to rather than the value. I'm just learning about sync and locks :laughing:

So feel free to just close this and ignore the point about RwLock.

happybeing avatar Jan 13 '25 15:01 happybeing