1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-11 01:39:33 +00:00

Fix/suppress clippy warnings (#1720)

This commit is contained in:
Yuki Okushi 2020-10-01 18:19:09 +09:00 committed by GitHub
parent aa11231ee5
commit c2c71cc626
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 3 deletions

View file

@ -7,6 +7,7 @@
clippy::new_without_default,
clippy::borrow_interior_mutable_const
)]
#![allow(clippy::manual_strip)] // Allow this to keep MSRV(1.42).
#[macro_use]
extern crate log;

View file

@ -67,6 +67,7 @@
#![deny(rust_2018_idioms)]
#![allow(clippy::needless_doctest_main, clippy::type_complexity)]
#![allow(clippy::rc_buffer)] // FXIME: We should take a closer look for the warnings at some point.
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

View file

@ -58,7 +58,6 @@ type BoxedResponse = LocalBoxFuture<'static, Result<ServiceResponse, Error>>;
/// * /{project_id}/path1 - responds to all http method
/// * /{project_id}/path2 - `GET` requests
/// * /{project_id}/path3 - `HEAD` requests
///
pub struct Scope<T = ScopeEndpoint> {
endpoint: T,
rdef: String,

View file

@ -283,7 +283,7 @@ impl JsonConfig {
fn from_req(req: &HttpRequest) -> &Self {
req.app_data::<Self>()
.or_else(|| req.app_data::<web::Data<Self>>().map(|d| d.as_ref()))
.unwrap_or_else(|| &DEFAULT_CONFIG)
.unwrap_or(&DEFAULT_CONFIG)
}
}

View file

@ -284,7 +284,7 @@ impl PayloadConfig {
fn from_req(req: &HttpRequest) -> &Self {
req.app_data::<Self>()
.or_else(|| req.app_data::<web::Data<Self>>().map(|d| d.as_ref()))
.unwrap_or_else(|| &DEFAULT_CONFIG)
.unwrap_or(&DEFAULT_CONFIG)
}
}