Fix findings from cargo clippy.

This commit is contained in:
Jacob Hoffman-Andrews
2020-06-12 21:17:58 -07:00
committed by Martin Algesten
parent b4c15eef2c
commit 378ef57636
4 changed files with 10 additions and 15 deletions

View File

@@ -252,13 +252,11 @@ pub(crate) fn connect_host(unit: &Unit, hostname: &str, port: u16) -> Result<Tcp
hostname,
port,
)
} else if has_timeout {
let timeout = Duration::from_millis(timeout_connect);
TcpStream::connect_timeout(&sock_addr, timeout)
} else {
if has_timeout {
let timeout = Duration::from_millis(timeout_connect);
TcpStream::connect_timeout(&sock_addr, timeout)
} else {
TcpStream::connect(&sock_addr)
}
TcpStream::connect(&sock_addr)
};
if let Ok(stream) = stream {