From 1ab0e0d47f44cb435e0d30e662ced3a37717c479 Mon Sep 17 00:00:00 2001 From: quentin Date: Sat, 19 Oct 2024 20:26:45 +0300 Subject: [PATCH] fixed some clippy issues --- caching/src/redis/client.rs | 4 ++-- caching/src/redis/redis.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/caching/src/redis/client.rs b/caching/src/redis/client.rs index 5b3e404..224d4e4 100644 --- a/caching/src/redis/client.rs +++ b/caching/src/redis/client.rs @@ -31,7 +31,7 @@ impl RedisClient for redis::Client { let options = redis::SetOptions::default() .with_expiration(SetExpiry::EX(duration)); - if !connection.set_options::<_, _, ()>(key, value, options).await.is_ok() { + if connection.set_options::<_, _, ()>(key, value, options).await.is_err() { return Err(CachingRedisError::CannotSetValue) } @@ -55,7 +55,7 @@ impl RedisClient for redis::Client { return Err(CachingRedisError::CannotGetConnection) }; - if !redis::cmd("FLUSHALL").exec_async(&mut connection).await.is_ok() { + if redis::cmd("FLUSHALL").exec_async(&mut connection).await.is_err() { return Err(CachingRedisError::CannotSetValue) }; diff --git a/caching/src/redis/redis.rs b/caching/src/redis/redis.rs index 26e0035..f668828 100644 --- a/caching/src/redis/redis.rs +++ b/caching/src/redis/redis.rs @@ -253,7 +253,7 @@ mod test { let result = caching.get_or_set_cache::, _, NovaXError>(key, async { // error if serialized - Ok(panic!()) + panic!() }).await?; assert_eq!(result, vec![0u8, 1u8]);