From 6d47364f6241dde987b8585d4e449fe19a0a14b7 Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Mon, 11 Nov 2024 16:58:56 -0800 Subject: [PATCH] `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 --- integration/ducks/Cargo.toml | 2 +- integration/ducks/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/ducks/Cargo.toml b/integration/ducks/Cargo.toml index ab7a081fd1..09686a8718 100644 --- a/integration/ducks/Cargo.toml +++ b/integration/ducks/Cargo.toml @@ -11,7 +11,7 @@ publish = false anyhow = "1.0" bytes = { workspace = true } entropy = "0.4" -hyper = { version = "0.14", features = ["server"] } +hyper = { version = "0.14", features = ["server", "backports", "deprecated"] } once_cell = { workspace = true } shared = { path = "../shared" } sketches-ddsketch = "0.3" diff --git a/integration/ducks/src/main.rs b/integration/ducks/src/main.rs index 849bb5bf78..a930635254 100644 --- a/integration/ducks/src/main.rs +++ b/integration/ducks/src/main.rs @@ -16,7 +16,7 @@ use anyhow::Context; use bytes::BytesMut; use hyper::{ - body, + body::HttpBody, server::conn::{AddrIncoming, AddrStream}, service::{make_service_fn, service_fn}, Body, Method, Request, StatusCode, @@ -127,7 +127,7 @@ impl From<&SocketCounters> for SocketMetrics { #[tracing::instrument(level = "trace")] async fn http_req_handler(req: Request) -> Result, hyper::Error> { let (parts, body) = req.into_parts(); - let body = body::to_bytes(body).await?; + let body = body.collect().await?.to_bytes(); { let metric = HTTP_COUNTERS.get().expect("HTTP_COUNTERS not initialized");