diff --git a/src/client/request.rs b/src/client/request.rs index ef058373b..650f0eeaa 100644 --- a/src/client/request.rs +++ b/src/client/request.rs @@ -429,14 +429,13 @@ impl ClientRequestBuilder { { if let Some(parts) = parts(&mut self.request, &self.err) { match HeaderName::try_from(key) { - Ok(key) => match parts.headers.contains_key(&key) { - false => match value.try_into() { + Ok(key) => if !parts.headers.contains_key(&key) { + match value.try_into() { Ok(value) => { parts.headers.insert(key, value); } Err(e) => self.err = Some(e.into()), - }, - true => (), + } }, Err(e) => self.err = Some(e.into()), }; diff --git a/tests/test_ws.rs b/tests/test_ws.rs index 96d97b824..66a9153dc 100644 --- a/tests/test_ws.rs +++ b/tests/test_ws.rs @@ -9,7 +9,6 @@ use bytes::Bytes; use futures::Stream; use rand::distributions::Alphanumeric; use rand::Rng; -use std::time::Duration; #[cfg(feature = "alpn")] extern crate openssl;