Skip to content

Commit

Permalink
πŸ“Ž thanks clippy πŸ–‡
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed Nov 25, 2020
1 parent b22070d commit e564c8a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Encoder {
}
}

fn finalize_headers(&mut self) -> io::Result<()> {
fn finalize_headers(&mut self) {
// If the body isn't streaming, we can set the content-length ahead of time. Else we need to
// send all items in chunks.
if let Some(len) = self.response.len() {
Expand All @@ -76,7 +76,6 @@ impl Encoder {
let date = fmt_http_date(SystemTime::now());
self.response.insert_header(DATE, date);
}
Ok(())
}

/// Encode the headers to a buffer, the first time we poll.
Expand All @@ -86,7 +85,7 @@ impl Encoder {
let status = self.response.status();
write!(head, "HTTP/1.1 {} {}\r\n", status, reason)?;

self.finalize_headers()?;
self.finalize_headers();
let mut headers = self.response.iter().collect::<Vec<_>>();
headers.sort_unstable_by_key(|(h, _)| h.as_str());
for (header, values) in headers {
Expand Down

0 comments on commit e564c8a

Please sign in to comment.