@@ -26,7 +26,7 @@ impl RedisCache {
2626 /// Returns a `CacheError` if the URL is invalid or connection cannot be established.
2727 pub fn new ( url : & str ) -> Result < Self , CacheError > {
2828 let client =
29- Client :: open ( url) . map_err ( |e| CacheError ( format ! ( "failed to create client: {}" , e ) ) ) ?;
29+ Client :: open ( url) . map_err ( |e| CacheError ( format ! ( "failed to create client: {e}" ) ) ) ?;
3030 Ok ( Self { client } )
3131 }
3232
@@ -35,7 +35,7 @@ impl RedisCache {
3535 self . client
3636 . get_multiplexed_async_connection ( )
3737 . await
38- . map_err ( |e| CacheError ( format ! ( "connection error: {}" , e ) ) )
38+ . map_err ( |e| CacheError ( format ! ( "connection error: {e}" ) ) )
3939 }
4040}
4141
@@ -44,7 +44,7 @@ impl Cache for RedisCache {
4444 let mut conn = self . get_connection ( ) . await ?;
4545
4646 let result: Option < Vec < u8 > > =
47- conn. get ( key) . await . map_err ( |e| CacheError ( format ! ( "get error: {}" , e ) ) ) ?;
47+ conn. get ( key) . await . map_err ( |e| CacheError ( format ! ( "get error: {e}" ) ) ) ?;
4848
4949 Ok ( result. map ( Bytes :: from) )
5050 }
@@ -58,15 +58,15 @@ impl Cache for RedisCache {
5858 // Use SETEX for atomic set with expiration
5959 conn. set_ex :: < _ , _ , ( ) > ( key, value. as_ref ( ) , ttl_secs)
6060 . await
61- . map_err ( |e| CacheError ( format ! ( "put error: {}" , e ) ) ) ?;
61+ . map_err ( |e| CacheError ( format ! ( "put error: {e}" ) ) ) ?;
6262
6363 Ok ( ( ) )
6464 }
6565
6666 async fn delete ( & self , key : & str ) -> Result < ( ) , CacheError > {
6767 let mut conn = self . get_connection ( ) . await ?;
6868
69- conn. del :: < _ , ( ) > ( key) . await . map_err ( |e| CacheError ( format ! ( "delete error: {}" , e ) ) ) ?;
69+ conn. del :: < _ , ( ) > ( key) . await . map_err ( |e| CacheError ( format ! ( "delete error: {e}" ) ) ) ?;
7070
7171 Ok ( ( ) )
7272 }
0 commit comments