Skip to content

Commit

Permalink
fixed some clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gfusee committed Oct 19, 2024
1 parent 1f83a51 commit 1ab0e0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions caching/src/redis/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
};

Expand Down
2 changes: 1 addition & 1 deletion caching/src/redis/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ mod test {
let result = caching.get_or_set_cache::<Vec<u8>, _, NovaXError>(key, async {
// error if serialized

Ok(panic!())
panic!()
}).await?;

assert_eq!(result, vec![0u8, 1u8]);
Expand Down

0 comments on commit 1ab0e0d

Please sign in to comment.