Skip to content

Implications of Arc<K>: Borrow<Q> #163

Answered by tatsuya6502
JayKickliter asked this question in Q&A
Discussion options

You must be logged in to vote

@JayKickliter — Thank you for reporting. I have converted this into a GitHub issue #166 and let me try to fix it.

Is this an absolute requirement for this kind of cache or an implementation detail?

I would say it is an implementation detail.

Moka cache wraps K by Arc when storing K to the internal storage, and the trait bound Arc<K>: Borrow<Q> does not work when K is Vec<u8> and Q is &[u8]. (Of course, it works when Q is &Vec<u8>). The same thing happens when K is String and Q is &str.

I tried briefly and could not fix. But there has got to be a way.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@tatsuya6502
Comment options

@tatsuya6502
Comment options

Answer selected by tatsuya6502
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants