diff --git a/src/rm.rs b/src/rm.rs index 283d5a5..3b435b6 100644 --- a/src/rm.rs +++ b/src/rm.rs @@ -38,8 +38,12 @@ use crate::index; /// # Ok(()) /// # } /// ``` -pub async fn entry>(cache: P, key: &str) -> Result<()> { - Ok(index::delete_async(cache.as_ref(), &key).await?) +pub async fn entry(cache: P, key: K) -> Result<()> +where + P: AsRef, + K: AsRef, +{ + index::delete_async(cache.as_ref(), key.as_ref()).await } /// Removes an individual content entry. Any index entries pointing to this @@ -131,8 +135,12 @@ pub async fn all>(cache: P) -> Result<()> { /// # Ok(()) /// # } /// ``` -pub fn entry_sync>(cache: P, key: &str) -> Result<()> { - Ok(index::delete(cache.as_ref(), &key)?) +pub fn entry_sync(cache: P, key: K) -> Result<()> +where + P: AsRef, + K: AsRef, +{ + index::delete(cache.as_ref(), key.as_ref()) } /// Removes an individual content entry synchronously. Any index entries