1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-01-18 13:51:50 +01:00

clippy warnings

This commit is contained in:
Nikolay Kim 2017-10-09 23:10:15 -07:00
parent 676347d7f6
commit be7bda65ef
2 changed files with 3 additions and 5 deletions

View File

@ -28,10 +28,8 @@ pub trait Message {
if let Ok(conn) = conn.to_str() { if let Ok(conn) = conn.to_str() {
if self.version() == Version::HTTP_10 && !conn.contains("keep-alive") { if self.version() == Version::HTTP_10 && !conn.contains("keep-alive") {
false false
} else if self.version() == Version::HTTP_11 && conn.contains("close") {
false
} else { } else {
true self.version() == Version::HTTP_11 && conn.contains("close")
} }
} else { } else {
false false
@ -163,7 +161,7 @@ impl HttpRequest {
} }
pub(crate) fn is_upgrade(&self) -> bool { pub(crate) fn is_upgrade(&self) -> bool {
if let Some(ref conn) = self.headers().get(header::CONNECTION) { if let Some(conn) = self.headers().get(header::CONNECTION) {
if let Ok(s) = conn.to_str() { if let Ok(s) = conn.to_str() {
return s.to_lowercase().contains("upgrade") return s.to_lowercase().contains("upgrade")
} }

View File

@ -261,7 +261,7 @@ pub fn parse(buf: &mut BytesMut) -> Result<Option<(HttpRequest, Option<Decoder>)
Some(Decoder::eof()) Some(Decoder::eof())
} }
// Content-Length // Content-Length
else if let Some(ref len) = msg.headers().get(header::CONTENT_LENGTH) { else if let Some(len) = msg.headers().get(header::CONTENT_LENGTH) {
if chunked { if chunked {
return Err(Error::Header) return Err(Error::Header)
} }