From c2c71cc6269fa5a432a51e2802be5f2327d7633a Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 1 Oct 2020 18:19:09 +0900 Subject: [PATCH] Fix/suppress clippy warnings (#1720) --- actix-http/src/lib.rs | 1 + src/lib.rs | 1 + src/scope.rs | 1 - src/types/json.rs | 2 +- src/types/payload.rs | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/actix-http/src/lib.rs b/actix-http/src/lib.rs index b52e8179c..fab91be2b 100644 --- a/actix-http/src/lib.rs +++ b/actix-http/src/lib.rs @@ -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; diff --git a/src/lib.rs b/src/lib.rs index 327cba954..edc8456ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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")] diff --git a/src/scope.rs b/src/scope.rs index 25b5366d8..2520fd7ae 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -58,7 +58,6 @@ type BoxedResponse = LocalBoxFuture<'static, Result>; /// * /{project_id}/path1 - responds to all http method /// * /{project_id}/path2 - `GET` requests /// * /{project_id}/path3 - `HEAD` requests -/// pub struct Scope { endpoint: T, rdef: String, diff --git a/src/types/json.rs b/src/types/json.rs index 8da5a3bdb..081a022e8 100644 --- a/src/types/json.rs +++ b/src/types/json.rs @@ -283,7 +283,7 @@ impl JsonConfig { fn from_req(req: &HttpRequest) -> &Self { req.app_data::() .or_else(|| req.app_data::>().map(|d| d.as_ref())) - .unwrap_or_else(|| &DEFAULT_CONFIG) + .unwrap_or(&DEFAULT_CONFIG) } } diff --git a/src/types/payload.rs b/src/types/payload.rs index bbdd89525..4ff5ef4b4 100644 --- a/src/types/payload.rs +++ b/src/types/payload.rs @@ -284,7 +284,7 @@ impl PayloadConfig { fn from_req(req: &HttpRequest) -> &Self { req.app_data::() .or_else(|| req.app_data::>().map(|d| d.as_ref())) - .unwrap_or_else(|| &DEFAULT_CONFIG) + .unwrap_or(&DEFAULT_CONFIG) } }