jeromefroe / lru-rs

An implementation of a LRU cache
https://docs.rs/lru/
MIT License
644 stars 106 forks source link

Cache key may not work #167

Closed mokeyish closed 1 year ago

mokeyish commented 1 year ago

图片

mokeyish commented 1 year ago

It seems because of KeyRef?

https://github.com/jeromefroe/lru-rs/blob/69d703e1ea395315fff8425bed6d26967ba7b0c3/src/lib.rs#L192

jeromefroe commented 1 year ago

@mokeyish do you by chance have a reproducible example of the error you're running into? Having the code for an example would make it easier to debug. There's also some changes for the KeyRef type in #166 that might be relevant to this issue.

mokeyish commented 1 year ago

Code here

https://github.com/mokeyish/smartdns-rs/blob/fc07b91c87a6303d171d9ec88536c9a4d1b4d2c9/src/dns_mw_cache.rs#L853

mokeyish commented 1 year ago

The reason may be that the key is deserialized by BinDecoder.

mokeyish commented 1 year ago

I found the cause of the problem, not because of this.