cargo clippy & cargo fmt

This commit is contained in:
Pierre HUBERT 2022-04-03 14:31:57 +02:00
parent d2daeb5879
commit 8574a328c9

View File

@ -3,10 +3,10 @@ use std::path::{Path, PathBuf};
use actix_files::{Files, NamedFile};
use actix_multipart::Multipart;
use actix_web::{App, Error, HttpRequest, HttpResponse, HttpServer, web};
use actix_web::dev::{fn_service, ServiceRequest, ServiceResponse};
use actix_web::error::{ErrorBadRequest, ErrorInternalServerError, ErrorUnauthorized};
use actix_web::middleware::Logger;
use actix_web::{web, App, Error, HttpRequest, HttpResponse, HttpServer};
use bytes::BufMut;
use clap::Parser;
use futures_util::TryStreamExt;
@ -224,9 +224,11 @@ async fn default_files_handler(req: ServiceRequest) -> Result<ServiceResponse, E
// Search for alternate paths
if args.can_bypass_html_ext
&& !req.path().ends_with(".html")
&& !req.path().ends_with("/")
&& !req.path().is_empty() {
let alt_file = args.storage_path()
&& !req.path().ends_with('/')
&& !req.path().is_empty()
{
let alt_file = args
.storage_path()
.join(format!("{}.html", &req.path()[1..]));
if alt_file.exists() {
@ -242,7 +244,6 @@ async fn default_files_handler(req: ServiceRequest) -> Result<ServiceResponse, E
let res = file.into_response(&req);
Ok(ServiceResponse::new(req, res))
}
// Dummy response
else {
Ok(ServiceResponse::new(