From 9ba72ce3fdc80a49101d594b0510b7fbed079371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 30 Jan 2022 15:55:35 +0100 Subject: [PATCH] Upgrade itoa to version 1 --- Cargo.lock | 4 ++-- aquatic_http/Cargo.toml | 2 +- aquatic_http/src/workers/socket.rs | 2 +- aquatic_http_protocol/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c29959f..1326442 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,7 +97,7 @@ dependencies = [ "futures-lite", "futures-rustls", "glommio 0.6.0 (git+https://github.com/DataDog/glommio.git?rev=4e6b14772da2f4325271fbcf12d24cf91ed466e5)", - "itoa 0.4.8", + "itoa 1.0.1", "log", "memchr", "mimalloc", @@ -146,7 +146,7 @@ dependencies = [ "hashbrown 0.11.2", "hex", "httparse", - "itoa 0.4.8", + "itoa 1.0.1", "log", "memchr", "quickcheck", diff --git a/aquatic_http/Cargo.toml b/aquatic_http/Cargo.toml index 5d1df0b..67ac669 100644 --- a/aquatic_http/Cargo.toml +++ b/aquatic_http/Cargo.toml @@ -26,7 +26,7 @@ either = "1" futures-lite = "1" futures-rustls = "0.22" glommio = { git = "https://github.com/DataDog/glommio.git", rev = "4e6b14772da2f4325271fbcf12d24cf91ed466e5" } -itoa = "0.4" +itoa = "1" log = "0.4" mimalloc = { version = "0.1", default-features = false } memchr = "2" diff --git a/aquatic_http/src/workers/socket.rs b/aquatic_http/src/workers/socket.rs index a3fb70b..60a4dd4 100644 --- a/aquatic_http/src/workers/socket.rs +++ b/aquatic_http/src/workers/socket.rs @@ -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"); diff --git a/aquatic_http_protocol/Cargo.toml b/aquatic_http_protocol/Cargo.toml index 718646a..6934321 100644 --- a/aquatic_http_protocol/Cargo.toml +++ b/aquatic_http_protocol/Cargo.toml @@ -26,7 +26,7 @@ anyhow = "1" hashbrown = "0.11" hex = { version = "0.4", default-features = false } httparse = "1" -itoa = "0.4" +itoa = "1" log = "0.4" memchr = "2" rand = { version = "0.8", features = ["small_rng"] }