mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 06:57:43 +02:00
chore: address clippy warnings
This commit is contained in:
@ -511,7 +511,8 @@ where
|
||||
let h2 = sock
|
||||
.ssl()
|
||||
.selected_alpn_protocol()
|
||||
.map_or(false, |protos| protos.windows(2).any(|w| w == H2));
|
||||
.is_some_and(|protos| protos.windows(2).any(|w| w == H2));
|
||||
|
||||
if h2 {
|
||||
(Box::new(sock), Protocol::Http2)
|
||||
} else {
|
||||
@ -550,7 +551,8 @@ where
|
||||
.get_ref()
|
||||
.1
|
||||
.alpn_protocol()
|
||||
.map_or(false, |protos| protos.windows(2).any(|w| w == H2));
|
||||
.is_some_and(|protos| protos.windows(2).any(|w| w == H2));
|
||||
|
||||
if h2 {
|
||||
(Box::new(sock), Protocol::Http2)
|
||||
} else {
|
||||
@ -584,7 +586,8 @@ where
|
||||
.get_ref()
|
||||
.1
|
||||
.alpn_protocol()
|
||||
.map_or(false, |protos| protos.windows(2).any(|w| w == H2));
|
||||
.is_some_and(|protos| protos.windows(2).any(|w| w == H2));
|
||||
|
||||
if h2 {
|
||||
(Box::new(sock), Protocol::Http2)
|
||||
} else {
|
||||
@ -621,7 +624,8 @@ where
|
||||
.get_ref()
|
||||
.1
|
||||
.alpn_protocol()
|
||||
.map_or(false, |protos| protos.windows(2).any(|w| w == H2));
|
||||
.is_some_and(|protos| protos.windows(2).any(|w| w == H2));
|
||||
|
||||
if h2 {
|
||||
(Box::new(sock), Protocol::Http2)
|
||||
} else {
|
||||
@ -655,7 +659,8 @@ where
|
||||
.get_ref()
|
||||
.1
|
||||
.alpn_protocol()
|
||||
.map_or(false, |protos| protos.windows(2).any(|w| w == H2));
|
||||
.is_some_and(|protos| protos.windows(2).any(|w| w == H2));
|
||||
|
||||
if h2 {
|
||||
(Box::new(sock), Protocol::Http2)
|
||||
} else {
|
||||
|
@ -444,7 +444,7 @@ struct Host<'a> {
|
||||
port: Option<http::uri::Port<&'a str>>,
|
||||
}
|
||||
|
||||
impl<'a> fmt::Display for Host<'a> {
|
||||
impl fmt::Display for Host<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(self.hostname)?;
|
||||
|
||||
|
Reference in New Issue
Block a user