diff --git a/actix-http/src/builder.rs b/actix-http/src/builder.rs index 1b5da20b6..408ee7924 100644 --- a/actix-http/src/builder.rs +++ b/actix-http/src/builder.rs @@ -36,6 +36,7 @@ where >::Future: 'static, { /// Create instance of `ServiceConfigBuilder` + #[allow(clippy::new_without_default)] pub fn new() -> Self { HttpServiceBuilder { keep_alive: KeepAlive::Timeout(5), diff --git a/actix-http/src/lib.rs b/actix-http/src/lib.rs index ae822a055..2b7bc730b 100644 --- a/actix-http/src/lib.rs +++ b/actix-http/src/lib.rs @@ -19,7 +19,6 @@ #![allow( clippy::type_complexity, clippy::too_many_arguments, - clippy::new_without_default, clippy::borrow_interior_mutable_const )] #![doc(html_logo_url = "https://actix.rs/img/logo.png")] @@ -28,6 +27,9 @@ #[macro_use] extern crate log; +pub use ::http::{uri, uri::Uri}; +pub use ::http::{Method, StatusCode, Version}; + pub mod body; mod builder; mod config; @@ -61,9 +63,6 @@ pub use self::requests::{Request, RequestHead, RequestHeadType}; pub use self::responses::{Response, ResponseBuilder, ResponseHead}; pub use self::service::HttpService; -pub use ::http::{uri, uri::Uri}; -pub use ::http::{Method, StatusCode, Version}; - /// A major HTTP protocol version. #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] #[non_exhaustive] diff --git a/actix-http/src/message.rs b/actix-http/src/message.rs index 2692a4bee..34213f68a 100644 --- a/actix-http/src/message.rs +++ b/actix-http/src/message.rs @@ -43,6 +43,7 @@ pub struct Message { impl Message { /// Get new message from the pool of objects + #[allow(clippy::new_without_default)] pub fn new() -> Self { T::with_pool(MessagePool::get_message) } diff --git a/actix-http/src/payload.rs b/actix-http/src/payload.rs index 89a1a2db1..69840e7c1 100644 --- a/actix-http/src/payload.rs +++ b/actix-http/src/payload.rs @@ -1,5 +1,7 @@ -use std::pin::Pin; -use std::task::{Context, Poll}; +use std::{ + pin::Pin, + task::{Context, Poll}, +}; use bytes::Bytes; use futures_core::Stream; diff --git a/actix-http/src/requests/request.rs b/actix-http/src/requests/request.rs index 74347fbc2..0254a8f11 100644 --- a/actix-http/src/requests/request.rs +++ b/actix-http/src/requests/request.rs @@ -59,6 +59,7 @@ impl From> for Request { impl Request { /// Create new Request instance + #[allow(clippy::new_without_default)] pub fn new() -> Request { Request { head: Message::new(), diff --git a/actix-http/src/responses/response.rs b/actix-http/src/responses/response.rs index d781bdfaa..ec9157afb 100644 --- a/actix-http/src/responses/response.rs +++ b/actix-http/src/responses/response.rs @@ -10,10 +10,9 @@ use bytestring::ByteString; use crate::{ body::{BoxBody, MessageBody}, - extensions::Extensions, header::{self, HeaderMap, TryIntoHeaderValue}, - responses::{BoxedResponseHead, ResponseBuilder, ResponseHead}, - Error, StatusCode, + responses::BoxedResponseHead, + Error, Extensions, ResponseBuilder, ResponseHead, StatusCode, }; /// An HTTP response.