mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
clippy
This commit is contained in:
parent
14bcf72ec1
commit
8d260e599f
@ -27,7 +27,7 @@ impl<'a> ResourcePath for &'a str {
|
|||||||
|
|
||||||
impl ResourcePath for bytestring::ByteString {
|
impl ResourcePath for bytestring::ByteString {
|
||||||
fn path(&self) -> &str {
|
fn path(&self) -> &str {
|
||||||
&*self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,6 +319,7 @@ mod tests {
|
|||||||
.to_request();
|
.to_request();
|
||||||
let res = test::call_service(&app, req).await;
|
let res = test::call_service(&app, req).await;
|
||||||
assert_eq!(res.status(), StatusCode::OK);
|
assert_eq!(res.status(), StatusCode::OK);
|
||||||
|
#[allow(clippy::mutable_key_type)]
|
||||||
let vary_headers = res.headers().get_all(header::VARY).collect::<HashSet<_>>();
|
let vary_headers = res.headers().get_all(header::VARY).collect::<HashSet<_>>();
|
||||||
assert!(vary_headers.contains(&HeaderValue::from_static("x-test")));
|
assert!(vary_headers.contains(&HeaderValue::from_static("x-test")));
|
||||||
assert!(vary_headers.contains(&HeaderValue::from_static("accept-encoding")));
|
assert!(vary_headers.contains(&HeaderValue::from_static("accept-encoding")));
|
||||||
|
@ -253,7 +253,7 @@ impl HttpRequest {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub fn connection_info(&self) -> Ref<'_, ConnectionInfo> {
|
pub fn connection_info(&self) -> Ref<'_, ConnectionInfo> {
|
||||||
if !self.extensions().contains::<ConnectionInfo>() {
|
if !self.extensions().contains::<ConnectionInfo>() {
|
||||||
let info = ConnectionInfo::new(self.head(), &*self.app_config());
|
let info = ConnectionInfo::new(self.head(), self.app_config());
|
||||||
self.extensions_mut().insert(info);
|
self.extensions_mut().insert(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,6 +401,8 @@ where
|
|||||||
.into_factory()
|
.into_factory()
|
||||||
.map_err(|err| err.into().error_response());
|
.map_err(|err| err.into().error_response());
|
||||||
|
|
||||||
|
// false positive lint (?)
|
||||||
|
#[allow(clippy::significant_drop_in_scrutinee)]
|
||||||
let acceptor_config = match c.tls_handshake_timeout {
|
let acceptor_config = match c.tls_handshake_timeout {
|
||||||
Some(dur) => TlsAcceptorConfig::default().handshake_timeout(dur),
|
Some(dur) => TlsAcceptorConfig::default().handshake_timeout(dur),
|
||||||
None => TlsAcceptorConfig::default(),
|
None => TlsAcceptorConfig::default(),
|
||||||
|
@ -134,6 +134,7 @@ where
|
|||||||
/// ```
|
/// ```
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct PathConfig {
|
pub struct PathConfig {
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
err_handler: Option<Arc<dyn Fn(PathError, &HttpRequest) -> Error + Send + Sync>>,
|
err_handler: Option<Arc<dyn Fn(PathError, &HttpRequest) -> Error + Send + Sync>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,6 +169,7 @@ impl<T: DeserializeOwned> FromRequest for Query<T> {
|
|||||||
/// ```
|
/// ```
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct QueryConfig {
|
pub struct QueryConfig {
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
err_handler: Option<Arc<dyn Fn(QueryPayloadError, &HttpRequest) -> Error + Send + Sync>>,
|
err_handler: Option<Arc<dyn Fn(QueryPayloadError, &HttpRequest) -> Error + Send + Sync>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user