Upgrade itoa to version 1

This commit is contained in:
Joakim Frostegård 2022-01-30 15:55:35 +01:00
parent 391c55a19e
commit 9ba72ce3fd
4 changed files with 5 additions and 5 deletions

View file

@ -416,7 +416,7 @@ impl Connection {
let mut response_bytes = Vec::with_capacity(39 + content_len_num_digits + body.len());
response_bytes.extend_from_slice(b"HTTP/1.1 200 OK\r\nContent-Length: ");
::itoa::write(&mut response_bytes, content_len)?;
response_bytes.extend_from_slice(::itoa::Buffer::new().format(content_len).as_bytes());
response_bytes.extend_from_slice(b"\r\n\r\n");
response_bytes.append(&mut body);
response_bytes.extend_from_slice(b"\r\n");