style(lib): address most clippy lints

This commit is contained in:
danieleades
2020-01-03 17:40:32 +00:00
committed by Sean McArthur
parent 0f13719873
commit 0eaf304644
29 changed files with 162 additions and 200 deletions

View File

@@ -472,10 +472,8 @@ impl Http1Transaction for Server {
continue 'headers;
}
header::CONNECTION => {
if !is_last {
if headers::connection_close(&value) {
is_last = true;
}
if !is_last && headers::connection_close(&value) {
is_last = true;
}
if !is_name_written {
is_name_written = true;
@@ -594,9 +592,8 @@ impl Server {
}
fn can_chunked(method: &Option<Method>, status: StatusCode) -> bool {
if method == &Some(Method::HEAD) {
false
} else if method == &Some(Method::CONNECT) && status.is_success() {
if method == &Some(Method::HEAD) || method == &Some(Method::CONNECT) && status.is_success()
{
false
} else {
match status {
@@ -766,7 +763,7 @@ impl Client {
101 => {
return Ok(Some((DecodedLength::ZERO, true)));
}
100..=199 => {
100 | 102..=199 => {
trace!("ignoring informational response: {}", inc.subject.as_u16());
return Ok(None);
}