cargo-fix
This commit is contained in:
parent
284703134d
commit
109afa50ab
|
@ -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)]
|
||||
|
|
10
src/main.rs
10
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,
|
||||
|
|
Loading…
Reference in New Issue