mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-23 16:21:06 +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 {
|
||||
fn path(&self) -> &str {
|
||||
&*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -319,6 +319,7 @@ mod tests {
|
||||
.to_request();
|
||||
let res = test::call_service(&app, req).await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
#[allow(clippy::mutable_key_type)]
|
||||
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("accept-encoding")));
|
||||
|
@ -253,7 +253,7 @@ impl HttpRequest {
|
||||
#[inline]
|
||||
pub fn connection_info(&self) -> Ref<'_, 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);
|
||||
}
|
||||
|
||||
|
@ -401,6 +401,8 @@ where
|
||||
.into_factory()
|
||||
.map_err(|err| err.into().error_response());
|
||||
|
||||
// false positive lint (?)
|
||||
#[allow(clippy::significant_drop_in_scrutinee)]
|
||||
let acceptor_config = match c.tls_handshake_timeout {
|
||||
Some(dur) => TlsAcceptorConfig::default().handshake_timeout(dur),
|
||||
None => TlsAcceptorConfig::default(),
|
||||
|
@ -134,6 +134,7 @@ where
|
||||
/// ```
|
||||
#[derive(Clone, Default)]
|
||||
pub struct PathConfig {
|
||||
#[allow(clippy::type_complexity)]
|
||||
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)]
|
||||
pub struct QueryConfig {
|
||||
#[allow(clippy::type_complexity)]
|
||||
err_handler: Option<Arc<dyn Fn(QueryPayloadError, &HttpRequest) -> Error + Send + Sync>>,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user