From 109afa50abbbab9f4c0d7f74c5ff595dd0dfaf29 Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Sun, 26 Mar 2023 09:33:10 -0400 Subject: [PATCH] cargo-fix --- src/error.rs | 4 ++-- src/main.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/error.rs b/src/error.rs index adb01a8..b743ad9 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,6 @@ -use actix_web::{error, HttpRequest}; + use actix_web::error::{JsonPayloadError, PayloadError}; -use actix_web::web::JsonConfig; + use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] diff --git a/src/main.rs b/src/main.rs index 72086cd..c53bec7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ -use actix_web::{App, HttpResponse, HttpServer, web, get, post, Responder, HttpRequest}; +use actix_web::{App, HttpResponse, HttpServer, post}; use actix_web::web::{Data, Json, JsonConfig}; -use diesel::{Connection, PgConnection}; +use diesel::{PgConnection}; use diesel::r2d2::ConnectionManager; use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; use log::{error, info, Level}; @@ -48,8 +48,8 @@ async fn main() -> std::io::Result<()> { info!("Connecting to database..."); - let mut manager = ConnectionManager::new(&CONFIG.db_uri); - let mut pool: PgPool = match Pool::builder().build(manager) { + let manager = ConnectionManager::new(&CONFIG.db_uri); + let pool: PgPool = match Pool::builder().build(manager) { Ok(c) => c, Err(e) => { error!("Error connecting to database: {}", e); @@ -80,7 +80,7 @@ async fn main() -> std::io::Result<()> { HttpServer::new(move || { App::new() .app_data(data.clone()) - .app_data(JsonConfig::default().error_handler(|err, req| { + .app_data(JsonConfig::default().error_handler(|err, _req| { let err2: APIError = (&err).into(); actix_web::error::InternalError::from_response( err,