1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01: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)
}
}