From 481cb95cd278e18a00481ef1aad6b5b0c89ec356 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Tue, 29 Jun 2021 20:12:51 +0530 Subject: [PATCH] addressing clippy lints --- src/api/v1/account/delete.rs | 13 ++----------- src/api/v1/auth.rs | 2 +- src/api/v1/meta.rs | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/api/v1/account/delete.rs b/src/api/v1/account/delete.rs index d897d7c4..72772858 100644 --- a/src/api/v1/account/delete.rs +++ b/src/api/v1/account/delete.rs @@ -57,20 +57,11 @@ async fn delete_account( Err(ServiceError::WrongPassword) } } - Err(RowNotFound) => return Err(ServiceError::UsernameNotFound), - Err(_) => return Err(ServiceError::InternalServerError), + Err(RowNotFound) => Err(ServiceError::UsernameNotFound), + Err(_) => Err(ServiceError::InternalServerError), } } pub fn services(cfg: &mut actix_web::web::ServiceConfig) { cfg.service(delete_account); - // use crate::define_resource; - // use crate::V1_API_ROUTES; - // - // define_resource!( - // cfg, - // V1_API_ROUTES.account.delete, - // Methods::ProtectPost, - // delete_account - // ); } diff --git a/src/api/v1/auth.rs b/src/api/v1/auth.rs index 4fcd1ec5..83ce9a4d 100644 --- a/src/api/v1/auth.rs +++ b/src/api/v1/auth.rs @@ -85,7 +85,7 @@ pub mod runners { } }; - if payload.login.contains("@") { + if payload.login.contains('@') { #[derive(Clone, Debug)] struct EmailLogin { name: String, diff --git a/src/api/v1/meta.rs b/src/api/v1/meta.rs index 7cb30669..b60d3756 100644 --- a/src/api/v1/meta.rs +++ b/src/api/v1/meta.rs @@ -144,7 +144,7 @@ mod tests { assert_eq!(resp.status(), StatusCode::OK); let health_resp: Health = test::read_body_json(resp).await; - assert_eq!(health_resp.db, true); + assert!(health_resp.db); assert_eq!(health_resp.redis, Some(true)); } }