Repository: jaemk/cached (language: rust)

Issue:
Why does `DiskCache` need to impl `Display`?
Looking at the docs for DiskCache [here](https://docs.rs/cached/latest/cached/stores/struct.DiskCache.html#impl-DiskCache%3CK,+V%3E), it defines:

```rs
impl<K, V> DiskCache<K, V>
where
    K: Display,
    V: Serialize + DeserializeOwned
```

Is there any particular reason why it needs to implement `Display`?


Discussion / hints:
If possible, could this be removed completely? If not, atleast be gated behind a feature?
@jaemk Could you take a look at this please?
@IgnisDa I think it'll move it faster, if you create a PR.
I tried to do it here but it did not work: https://github.com/IgnisDa/cached/tree/remove-display-trait
@IgnisDa I think _just_ replacing `Display` with `ToString` will do the job.

Fix patch:
diff --git a/src/stores/disk.rs b/src/stores/disk.rs
index f32453d..a6f5fc4 100644
--- a/src/stores/disk.rs
+++ b/src/stores/disk.rs
@@ -6,7 +6,7 @@ use serde::Serialize;
 use sled::Db;
 use std::marker::PhantomData;
 use std::path::Path;
-use std::{fmt::Display, path::PathBuf, time::SystemTime};
+use std::{path::PathBuf, time::SystemTime};
 
 pub struct DiskCacheBuilder<K, V> {
     seconds: Option<u64>,
@@ -36,7 +36,7 @@ const DISK_FILE_VERSION: u64 = 1;
 
 impl<K, V> DiskCacheBuilder<K, V>
 where
-    K: Display,
+    K: ToString,
     V: Serialize + DeserializeOwned,
 {
     /// Initialize a `DiskCacheBuilder`
@@ -158,7 +158,7 @@ pub struct DiskCache<K, V> {
 
 impl<K, V> DiskCache<K, V>
 where
-    K: Display,
+    K: ToString,
     V: Serialize + DeserializeOwned,
 {
     #[allow(clippy::new_ret_no_self)]
@@ -235,7 +235,7 @@ impl<V> CachedDiskValue<V> {
 
 impl<K, V> IOCached<K, V> for DiskCache<K, V>
 where
-    K: Display,
+    K: ToString,
     V: Serialize + DeserializeOwned,
 {
     type Error = DiskCacheError;


Test patch: