Skip to content

Commit

Permalink
refactor: Comparison to empty slice
Browse files Browse the repository at this point in the history
  • Loading branch information
bush1D3v committed Sep 7, 2024
1 parent da0678b commit cb6b722
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/user/user_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub async fn insert_user_service(
mut body: Json<InsertUserDTO>,
redis_user: String,
) -> Result<UserDTO, HttpResponse> {
if redis_user.is_empty() {
if !redis_user.is_empty() {
return Err(Exception::conflict(body.email.clone()));
}
match email_exists(postgres_pool, body.email.clone()).await {
Expand Down Expand Up @@ -121,7 +121,7 @@ pub async fn detail_user_service(
user_id: String,
redis_user: String,
) -> Result<UserDTO, HttpResponse> {
if redis_user.is_empty() {
if !redis_user.is_empty() {
match UserSerdes::serde_string_to_json(&redis_user) {
Ok(user) => Ok(user),
Err(e) => Err(e),
Expand Down Expand Up @@ -189,7 +189,7 @@ pub async fn put_user_service(
user_id: String,
redis_user: String,
) -> Result<UserDTO, HttpResponse> {
if redis_user.is_empty() {
if !redis_user.is_empty() {
return Err(Exception::conflict(body.email.clone()));
}
match email_exists(postgres_pool.clone(), body.new_email.clone()).await {
Expand Down

0 comments on commit cb6b722

Please sign in to comment.