1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-12 02:09:36 +00:00

Fix clippy warnings (#2217)

This commit is contained in:
Keita Nonaka 2021-05-15 09:13:33 +09:00 committed by GitHub
parent 2a8c650f2c
commit b1de196509
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -38,7 +38,7 @@ pub struct Files {
mime_override: Option<Rc<MimeOverride>>,
file_flags: named::Flags,
use_guards: Option<Rc<dyn Guard>>,
guards: Vec<Box<Rc<dyn Guard>>>,
guards: Vec<Rc<dyn Guard>>,
hidden_files: bool,
}
@ -199,7 +199,7 @@ impl Files {
/// );
/// ```
pub fn guard<G: Guard + 'static>(mut self, guard: G) -> Self {
self.guards.push(Box::new(Rc::new(guard)));
self.guards.push(Rc::new(guard));
self
}
@ -276,7 +276,7 @@ impl HttpServiceFactory for Files {
Some(
guards
.into_iter()
.map(|guard| -> Box<dyn Guard> { guard })
.map(|guard| -> Box<dyn Guard> { Box::new(guard) })
.collect::<Vec<_>>(),
)
};

View file

@ -84,7 +84,7 @@ impl<B> Response<B> {
pub fn with_body(status: StatusCode, body: B) -> Response<B> {
Response {
head: BoxedResponseHead::new(status),
body: body,
body,
}
}

View file

@ -1,4 +1,4 @@
use actix_web::{test, web, App, HttpResponse};
use actix_web::{web, App, HttpResponse};
use awc::Client;
use criterion::{criterion_group, criterion_main, Criterion};
use futures_util::future::join_all;

View file

@ -901,7 +901,7 @@ async fn test_normalize() {
let srv = actix_test::start_with(actix_test::config().h1(), || {
App::new()
.wrap(NormalizePath::new(TrailingSlash::Trim))
.service(web::resource("/one").route(web::to(|| HttpResponse::Ok())))
.service(web::resource("/one").route(web::to(HttpResponse::Ok)))
});
let response = srv.get("/one/").send().await.unwrap();