Fix findings from cargo clippy.
This commit is contained in:
committed by
Martin Algesten
parent
b4c15eef2c
commit
378ef57636
@@ -125,7 +125,7 @@ fn copy_chunked<R: Read, W: Write>(reader: &mut R, writer: &mut W) -> IoResult<u
|
||||
let header = header_str.as_bytes();
|
||||
assert!(header.len() <= CHUNK_HEADER_MAX_SIZE);
|
||||
let start_index = CHUNK_HEADER_MAX_SIZE - header.len();
|
||||
(&mut chunk[start_index..]).write(&header).unwrap();
|
||||
(&mut chunk[start_index..]).write_all(&header).unwrap();
|
||||
|
||||
// And add the footer
|
||||
chunk.extend_from_slice(b"\r\n");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::io::{Result as IoResult, Write};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use base64;
|
||||
use qstring::QString;
|
||||
use url::Url;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user