diff --git a/src/lib.rs b/src/lib.rs index 1daa5e1..ad8d813 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,8 @@ #![allow(clippy::match_like_matches_macro)] // we're not changing public api due to a lint. #![allow(clippy::upper_case_acronyms)] +#![allow(clippy::result_large_err)] +#![allow(clippy::only_used_in_recursion)] //!
//! diff --git a/src/proxy.rs b/src/proxy.rs index 3631055..ff94139 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -101,7 +101,7 @@ impl Proxy { }; let remaining_parts = proxy_parts.next(); - if remaining_parts == None { + if remaining_parts.is_none() { return Err(ErrorKind::InvalidProxyUrl.new()); } @@ -131,7 +131,7 @@ impl Proxy { pub(crate) fn connect>(&self, host: S, port: u16) -> String { let authorization = if self.use_authorization() { - let creds = base64::encode(&format!( + let creds = base64::encode(format!( "{}:{}", self.user.clone().unwrap_or_default(), self.password.clone().unwrap_or_default() diff --git a/src/stream.rs b/src/stream.rs index 5d6d52f..5f978a5 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -361,7 +361,8 @@ pub(crate) fn connect_host( debug!("connecting to {} at {}", netloc, &sock_addr); // connect with a configured timeout. - let stream = if None != proto && Some(Proto::HTTPConnect) != proto { + #[allow(clippy::unnecessary_unwrap)] + let stream = if proto.is_some() && Some(Proto::HTTPConnect) != proto { connect_socks( unit, proxy.clone().unwrap(), @@ -374,7 +375,7 @@ pub(crate) fn connect_host( } else if let Some(timeout) = timeout { TcpStream::connect_timeout(&sock_addr, timeout) } else { - TcpStream::connect(&sock_addr) + TcpStream::connect(sock_addr) }; if let Ok(stream) = stream { diff --git a/src/unit.rs b/src/unit.rs index 6fce8bb..785a90e 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -87,7 +87,7 @@ impl Unit { if (!username.is_empty() || !password.is_empty()) && get_header(&headers, "authorization").is_none() { - let encoded = base64::encode(&format!("{}:{}", username, password)); + let encoded = base64::encode(format!("{}:{}", username, password)); extra.push(Header::new("Authorization", &format!("Basic {}", encoded))); }