From be7bda65ef8f5021b08c3e5d0ea1c0b3d3bdd1bc Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 9 Oct 2017 23:10:15 -0700 Subject: [PATCH] clippy warnings --- src/httpmessage.rs | 6 ++---- src/reader.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/httpmessage.rs b/src/httpmessage.rs index ac8846be5..d951ed005 100644 --- a/src/httpmessage.rs +++ b/src/httpmessage.rs @@ -28,10 +28,8 @@ pub trait Message { if let Ok(conn) = conn.to_str() { if self.version() == Version::HTTP_10 && !conn.contains("keep-alive") { false - } else if self.version() == Version::HTTP_11 && conn.contains("close") { - false } else { - true + self.version() == Version::HTTP_11 && conn.contains("close") } } else { false @@ -163,7 +161,7 @@ impl HttpRequest { } 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() { return s.to_lowercase().contains("upgrade") } diff --git a/src/reader.rs b/src/reader.rs index c90592fc7..332444321 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -261,7 +261,7 @@ pub fn parse(buf: &mut BytesMut) -> Result) Some(Decoder::eof()) } // 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 { return Err(Error::Header) }