From b65ad29774d2a58372058d1aeafca5a423efb8d4 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 20 Sep 2022 14:39:47 +0200 Subject: Merge all crates import as `use crate::` --- src/files.rs | 3 +-- src/models/model.rs | 5 +---- src/models/user.rs | 4 +--- src/routes/auth.rs | 12 +++++++----- src/routes/model.rs | 16 +++++++++------- src/routes/user.rs | 14 ++++++++------ 6 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/files.rs b/src/files.rs index f72070b..b0f0ad5 100644 --- a/src/files.rs +++ b/src/files.rs @@ -1,5 +1,4 @@ -use crate::config::CONFIG; -use crate::errors::AppError; +use crate::{config::CONFIG, errors::AppError}; use axum::{ extract::{Multipart, Path}, http::header::{HeaderMap, HeaderName, HeaderValue}, diff --git a/src/models/model.rs b/src/models/model.rs index aed7b3a..08bfe88 100644 --- a/src/models/model.rs +++ b/src/models/model.rs @@ -1,7 +1,4 @@ -use crate::config::CONFIG; -use crate::db::get_client; - -use crate::errors::AppError; +use crate::{config::CONFIG, db::get_client, errors::AppError}; use serde_json::json; use sqlx::types::JsonValue; use sqlx::Row; diff --git a/src/models/user.rs b/src/models/user.rs index f905968..964a57c 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -1,6 +1,4 @@ -use crate::config::CONFIG; -use crate::db::get_client; -use crate::errors::AppError; +use crate::{config::CONFIG, db::get_client, errors::AppError}; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, NoneAsEmptyString}; diff --git a/src/routes/auth.rs b/src/routes/auth.rs index 7cd16ad..0fe92fc 100644 --- a/src/routes/auth.rs +++ b/src/routes/auth.rs @@ -1,9 +1,11 @@ -use crate::errors::AppError; -use crate::models::{ - auth::{AuthBody, Claims, LoginCredentials, SignUpForm}, - user::User, +use crate::{ + errors::AppError, + models::{ + auth::{AuthBody, Claims, LoginCredentials, SignUpForm}, + user::User, + }, + routes::JsonCreate, }; -use crate::routes::JsonCreate; use axum::{routing::post, Json, Router}; /// Create routes for `/v1/auth/` namespace diff --git a/src/routes/model.rs b/src/routes/model.rs index 98e41dc..3666504 100644 --- a/src/routes/model.rs +++ b/src/routes/model.rs @@ -1,11 +1,13 @@ -use crate::errors::AppError; -use crate::files::upload; -use crate::models::{ - auth::Claims, - model::{Model, ModelCreate, ModelUpload, ModelUser}, +use crate::{ + errors::AppError, + files::upload, + models::{ + auth::Claims, + model::{Model, ModelCreate, ModelUpload, ModelUser}, + }, + pagination::Pagination, + routes::JsonCreate, }; -use crate::pagination::Pagination; -use crate::routes::JsonCreate; use axum::{ extract::{ContentLengthLimit, Multipart, Path, Query}, routing::{get, post}, diff --git a/src/routes/user.rs b/src/routes/user.rs index 94db791..d20f1f6 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -1,10 +1,12 @@ -use crate::errors::AppError; -use crate::files::{delete_upload, upload}; -use crate::models::{ - auth::Claims, - user::{User, UserList}, +use crate::{ + errors::AppError, + files::{delete_upload, upload}, + models::{ + auth::Claims, + user::{User, UserList}, + }, + pagination::Pagination, }; -use crate::pagination::Pagination; use axum::{ extract::{ContentLengthLimit, Multipart, Path, Query}, routing::{get, put}, -- cgit v1.2.3-71-g8e6c