cached icon indicating copy to clipboard operation
cached copied to clipboard

Why does `DiskCache` need to impl `Display`?

Open IgnisDa opened this issue 1 year ago • 1 comments

Looking at the docs for DiskCache here, it defines:

impl<K, V> DiskCache<K, V>
where
    K: Display,
    V: Serialize + DeserializeOwned

Is there any particular reason why it needs to implement Display?

IgnisDa avatar Apr 23 '24 17:04 IgnisDa

If possible, could this be removed completely? If not, atleast be gated behind a feature?

IgnisDa avatar Apr 23 '24 17:04 IgnisDa

@jaemk Could you take a look at this please?

IgnisDa avatar Jun 06 '24 05:06 IgnisDa

@IgnisDa I think it'll move it faster, if you create a PR.

omid avatar Jun 06 '24 06:06 omid

I tried to do it here but it did not work: https://github.com/IgnisDa/cached/tree/remove-display-trait

IgnisDa avatar Jun 06 '24 08:06 IgnisDa

@IgnisDa I think just replacing Display with ToString will do the job.

omid avatar Jun 06 '24 09:06 omid

@omid Made a PR.

IgnisDa avatar Jun 06 '24 13:06 IgnisDa