Skip to content

Commit

Permalink
refactor: Removing unneeded return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
bush1D3v committed Jun 27, 2024
1 parent 8f6c52d commit 33b8b20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/user/user_controllers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ async fn detail_user(
email: user.email,
created_at: user.created_at,
};
return HttpResponse::Ok().json(DetailUserControllerResponse { user });
HttpResponse::Ok().json(DetailUserControllerResponse { user })
}
Err(e) => e,
}
}
Err(_) => {
match detail_user_service(pg_pool, user_id.clone()).await {
return match detail_user_service(pg_pool, user_id.clone()).await {
Ok(pg_user) => match UserSerdes::serde_json_to_string(&pg_user) {
Ok(redis_user) => {
let _ = Redis::set_redis(&redis_pool, &user_id, &redis_user).await;
Expand All @@ -387,11 +387,11 @@ async fn detail_user(
email: pg_user.email,
created_at: pg_user.created_at,
};
return HttpResponse::Ok().json(DetailUserControllerResponse { user });
HttpResponse::Ok().json(DetailUserControllerResponse { user })
}
Err(e) => return e,
Err(e) => e,
},
Err(e) => return e,
Err(e) => e,
};
}
};
Expand Down

0 comments on commit 33b8b20

Please sign in to comment.