From f165581e17faaaf42f574fdb5ce045d1963957a3 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 11 May 2022 20:11:11 +0530 Subject: [PATCH] chore: lints --- Makefile | 2 +- db/db-core/src/lib.rs | 3 --- db/db-sqlx-postgres/src/lib.rs | 1 - db/db-sqlx-postgres/src/tests.rs | 3 ++- src/api/v1/account/email.rs | 2 -- src/api/v1/account/password.rs | 1 - src/api/v1/auth.rs | 2 +- src/api/v1/meta.rs | 3 --- 8 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 7745649b..cd304ddd 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ test: frontend-test frontend ## Run all available tests cd db/db-sqlx-postgres &&\ DATABASE_URL=${POSTGRES_DATABASE_URL}\ cargo test --no-fail-fast - ./scripts/tests.sh +# ./scripts/tests.sh # cargo test --all-features --no-fail-fast xml-test-coverage: migrate ## Generate code coverage report in XML format diff --git a/db/db-core/src/lib.rs b/db/db-core/src/lib.rs index ef33a7ac..9650cba7 100644 --- a/db/db-core/src/lib.rs +++ b/db/db-core/src/lib.rs @@ -31,10 +31,7 @@ //! - [errors](crate::auth): error data structures used in this crate //! - [ops](crate::ops): meta operations like connection pool creation, migrations and getting //! connection from pool -use std::str::FromStr; - use serde::{Deserialize, Serialize}; -use url::Url; pub mod errors; pub mod ops; diff --git a/db/db-sqlx-postgres/src/lib.rs b/db/db-sqlx-postgres/src/lib.rs index 0f35220b..0250378d 100644 --- a/db/db-sqlx-postgres/src/lib.rs +++ b/db/db-sqlx-postgres/src/lib.rs @@ -15,7 +15,6 @@ * along with this program. If not, see . */ use db_core::dev::*; -use std::str::FromStr; use sqlx::postgres::PgPoolOptions; use sqlx::types::time::OffsetDateTime; diff --git a/db/db-sqlx-postgres/src/tests.rs b/db/db-sqlx-postgres/src/tests.rs index 8638e70d..49da6461 100644 --- a/db/db-sqlx-postgres/src/tests.rs +++ b/db/db-sqlx-postgres/src/tests.rs @@ -14,12 +14,13 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +#![cfg(test)] + use sqlx::postgres::PgPoolOptions; use std::env; use crate::*; -use db_core::prelude::*; use db_core::tests::*; #[actix_rt::test] diff --git a/src/api/v1/account/email.rs b/src/api/v1/account/email.rs index 17d13b9c..5ef678e3 100644 --- a/src/api/v1/account/email.rs +++ b/src/api/v1/account/email.rs @@ -14,8 +14,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -use std::borrow::Cow; - use actix_identity::Identity; use actix_web::{web, HttpResponse, Responder}; use db_core::UpdateEmail; diff --git a/src/api/v1/account/password.rs b/src/api/v1/account/password.rs index 9eb7170e..1fa56491 100644 --- a/src/api/v1/account/password.rs +++ b/src/api/v1/account/password.rs @@ -20,7 +20,6 @@ use argon2_creds::Config; use db_core::Login; use serde::{Deserialize, Serialize}; -use crate::api::v1::auth::runners::Password; use crate::errors::*; use crate::*; diff --git a/src/api/v1/auth.rs b/src/api/v1/auth.rs index 86e81476..db21a02c 100644 --- a/src/api/v1/auth.rs +++ b/src/api/v1/auth.rs @@ -139,7 +139,7 @@ pub mod runners { let p = db_core::Register { username: &username, hash: &hash, - email: payload.email.as_ref().map(|s| s.as_str()), + email: payload.email.as_deref(), secret: &secret, }; diff --git a/src/api/v1/meta.rs b/src/api/v1/meta.rs index 2179105f..1a4b0526 100644 --- a/src/api/v1/meta.rs +++ b/src/api/v1/meta.rs @@ -73,10 +73,7 @@ impl Health { /// checks all components of the system #[my_codegen::get(path = "crate::V1_API_ROUTES.meta.health")] async fn health(data: AppData) -> impl Responder { - use sqlx::Connection; - let mut resp_builder = HealthBuilder::default(); - resp_builder.redis = None; resp_builder.db(data.dblib.ping().await);