diff --git a/src/storage.rs b/src/storage.rs index 13fce2a..da45616 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -188,7 +188,7 @@ pub trait Map: Sync + Send { prefix: P, ) -> Result> + Send + 'a>> where - P: AsRef<[u8]> + Send, + P: AsRef<[u8]> + Send + Sync, V: DeserializeOwned + Sync + Send + 'a + 'static; #[cfg(feature = "ttl")] @@ -653,7 +653,7 @@ impl Map for StorageMap { prefix: P, ) -> Result> + Send + 'a>> where - P: AsRef<[u8]> + Send, + P: AsRef<[u8]> + Send + Sync, V: DeserializeOwned + Sync + Send + 'a + 'static, { match self { diff --git a/src/storage_redis.rs b/src/storage_redis.rs index 0a1e4dd..b368e06 100644 --- a/src/storage_redis.rs +++ b/src/storage_redis.rs @@ -751,7 +751,7 @@ impl Map for RedisStorageMap { prefix: P, ) -> Result> + Send + 'a>> where - P: AsRef<[u8]> + Send, + P: AsRef<[u8]> + Send + Sync, V: DeserializeOwned + Sync + Send + 'a + 'static, { let name = self.full_name.clone(); @@ -970,8 +970,7 @@ impl RedisStorageList { .rpush(name, val) .query_async(async_conn) .await?; - - Ok(if let Some(v) = poped { Some(v) } else { None }) + Ok(poped) } else { Err(anyhow::Error::msg("Is full")) } diff --git a/src/storage_sled.rs b/src/storage_sled.rs index ffc1438..540d8e5 100644 --- a/src/storage_sled.rs +++ b/src/storage_sled.rs @@ -2153,7 +2153,7 @@ impl Map for SledStorageMap { prefix: P, ) -> Result> + Send + 'a>> where - P: AsRef<[u8]> + Send, + P: AsRef<[u8]> + Send + Sync, V: DeserializeOwned + Sync + Send + 'a + 'static, { let this = self;