mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
refactor(ext_traits): simplify the signatures of some methods in Encode extension trait (#3687)
This commit is contained in:
@ -75,7 +75,8 @@ impl super::RedisConnectionPool {
|
||||
where
|
||||
V: serde::Serialize + Debug,
|
||||
{
|
||||
let serialized = Encode::<V>::encode_to_vec(&value)
|
||||
let serialized = value
|
||||
.encode_to_vec()
|
||||
.change_context(errors::RedisError::JsonSerializationFailed)?;
|
||||
self.set_key_if_not_exists_with_expiry(key, serialized.as_slice(), ttl)
|
||||
.await
|
||||
@ -90,7 +91,8 @@ impl super::RedisConnectionPool {
|
||||
where
|
||||
V: serde::Serialize + Debug,
|
||||
{
|
||||
let serialized = Encode::<V>::encode_to_vec(&value)
|
||||
let serialized = value
|
||||
.encode_to_vec()
|
||||
.change_context(errors::RedisError::JsonSerializationFailed)?;
|
||||
|
||||
self.set_key(key, serialized.as_slice()).await
|
||||
@ -106,7 +108,8 @@ impl super::RedisConnectionPool {
|
||||
where
|
||||
V: serde::Serialize + Debug,
|
||||
{
|
||||
let serialized = Encode::<V>::encode_to_vec(&value)
|
||||
let serialized = value
|
||||
.encode_to_vec()
|
||||
.change_context(errors::RedisError::JsonSerializationFailed)?;
|
||||
|
||||
self.pool
|
||||
@ -307,7 +310,8 @@ impl super::RedisConnectionPool {
|
||||
where
|
||||
V: serde::Serialize + Debug,
|
||||
{
|
||||
let serialized = Encode::<V>::encode_to_vec(&value)
|
||||
let serialized = value
|
||||
.encode_to_vec()
|
||||
.change_context(errors::RedisError::JsonSerializationFailed)?;
|
||||
|
||||
self.set_hash_field_if_not_exist(key, field, serialized.as_slice(), ttl)
|
||||
|
||||
Reference in New Issue
Block a user