Skip to content

Commit 28b6db2

Browse files
committed
ducks adds backports and deprecated features
I'm attempting to upgrade hyper et al in our project. This is a delicate business and I want to go slowly. I'm following the migration guide one crate at a time. Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent 31c9fb6 commit 28b6db2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

integration/ducks/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ publish = false
1111
anyhow = "1.0"
1212
bytes = { workspace = true }
1313
entropy = "0.4"
14-
hyper = { version = "0.14", features = ["server"] }
14+
hyper = { version = "0.14", features = ["server", "backports", "deprecated"] }
1515
once_cell = { workspace = true }
1616
shared = { path = "../shared" }
1717
sketches-ddsketch = "0.3"

integration/ducks/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use anyhow::Context;
1717
use bytes::BytesMut;
1818
use hyper::{
19-
body,
19+
body::HttpBody,
2020
server::conn::{AddrIncoming, AddrStream},
2121
service::{make_service_fn, service_fn},
2222
Body, Method, Request, StatusCode,
@@ -127,7 +127,7 @@ impl From<&SocketCounters> for SocketMetrics {
127127
#[tracing::instrument(level = "trace")]
128128
async fn http_req_handler(req: Request<Body>) -> Result<hyper::Response<Body>, hyper::Error> {
129129
let (parts, body) = req.into_parts();
130-
let body = body::to_bytes(body).await?;
130+
let body = body.collect().await?.to_bytes();
131131

132132
{
133133
let metric = HTTP_COUNTERS.get().expect("HTTP_COUNTERS not initialized");

0 commit comments

Comments
 (0)