mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-27 10:39:03 +02:00
clippy warnings
This commit is contained in:
@ -25,11 +25,7 @@ impl ConnectionInfo {
|
||||
Ref::map(req.extensions(), |e| e.get().unwrap())
|
||||
}
|
||||
|
||||
#[allow(
|
||||
clippy::cyclomatic_complexity,
|
||||
clippy::cognitive_complexity,
|
||||
clippy::borrow_interior_mutable_const
|
||||
)]
|
||||
#[allow(clippy::cognitive_complexity)]
|
||||
fn new(req: &RequestHead, cfg: &AppConfig) -> ConnectionInfo {
|
||||
let mut host = None;
|
||||
let mut scheme = None;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![allow(clippy::borrow_interior_mutable_const)]
|
||||
//! Actix web is a small, pragmatic, and extremely fast web framework
|
||||
//! for Rust.
|
||||
//!
|
||||
|
@ -107,7 +107,6 @@ where
|
||||
self.service.poll_ready()
|
||||
}
|
||||
|
||||
#[allow(clippy::borrow_interior_mutable_const)]
|
||||
fn call(&mut self, req: ServiceRequest) -> Self::Future {
|
||||
// negotiate content-encoding
|
||||
let encoding = if let Some(val) = req.headers().get(&ACCEPT_ENCODING) {
|
||||
|
@ -125,7 +125,6 @@ where
|
||||
self.service.poll_ready()
|
||||
}
|
||||
|
||||
#[allow(clippy::borrow_interior_mutable_const)]
|
||||
fn call(&mut self, req: ServiceRequest) -> Self::Future {
|
||||
let inner = self.inner.clone();
|
||||
|
||||
|
@ -288,13 +288,13 @@ where
|
||||
lst,
|
||||
move || {
|
||||
let c = cfg.lock();
|
||||
acceptor.clone().map_err(|e| SslError::Ssl(e)).and_then(
|
||||
acceptor.clone().map_err(SslError::Ssl).and_then(
|
||||
HttpService::build()
|
||||
.keep_alive(c.keep_alive)
|
||||
.client_timeout(c.client_timeout)
|
||||
.client_disconnect(c.client_shutdown)
|
||||
.finish(factory())
|
||||
.map_err(|e| SslError::Service(e))
|
||||
.map_err(SslError::Service)
|
||||
.map_init_err(|_| ()),
|
||||
)
|
||||
},
|
||||
@ -339,13 +339,13 @@ where
|
||||
lst,
|
||||
move || {
|
||||
let c = cfg.lock();
|
||||
acceptor.clone().map_err(|e| SslError::Ssl(e)).and_then(
|
||||
acceptor.clone().map_err(SslError::Ssl).and_then(
|
||||
HttpService::build()
|
||||
.keep_alive(c.keep_alive)
|
||||
.client_timeout(c.client_timeout)
|
||||
.client_disconnect(c.client_shutdown)
|
||||
.finish(factory())
|
||||
.map_err(|e| SslError::Service(e))
|
||||
.map_err(SslError::Service)
|
||||
.map_init_err(|_| ()),
|
||||
)
|
||||
},
|
||||
|
@ -79,7 +79,7 @@ where
|
||||
F: FnOnce() -> R,
|
||||
R: IntoFuture,
|
||||
{
|
||||
RT.with(move |rt| rt.borrow_mut().get_mut().block_on(lazy(|| f())))
|
||||
RT.with(move |rt| rt.borrow_mut().get_mut().block_on(lazy(f)))
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
@ -192,7 +192,6 @@ pub struct UrlEncoded<U> {
|
||||
|
||||
impl<U> UrlEncoded<U> {
|
||||
/// Create a new future to URL encode a request
|
||||
#[allow(clippy::borrow_interior_mutable_const)]
|
||||
pub fn new(req: &HttpRequest, payload: &mut Payload) -> UrlEncoded<U> {
|
||||
// check content type
|
||||
if req.content_type().to_lowercase() != "application/x-www-form-urlencoded" {
|
||||
|
@ -298,7 +298,6 @@ where
|
||||
U: DeserializeOwned + 'static,
|
||||
{
|
||||
/// Create `JsonBody` for request.
|
||||
#[allow(clippy::borrow_interior_mutable_const)]
|
||||
pub fn new(
|
||||
req: &HttpRequest,
|
||||
payload: &mut Payload,
|
||||
|
@ -298,7 +298,6 @@ pub struct HttpMessageBody {
|
||||
|
||||
impl HttpMessageBody {
|
||||
/// Create `MessageBody` for request.
|
||||
#[allow(clippy::borrow_interior_mutable_const)]
|
||||
pub fn new(req: &HttpRequest, payload: &mut dev::Payload) -> HttpMessageBody {
|
||||
let mut len = None;
|
||||
if let Some(l) = req.headers().get(&header::CONTENT_LENGTH) {
|
||||
|
Reference in New Issue
Block a user