aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/lib.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-05 14:44:12 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-05 14:44:12 +0100
commit6e69a1fffc715c752a399750c1e26aa46683dbb2 (patch)
treed1539c6107372f14aa6ca09255977df69411a553 /src/garage/tests/lib.rs
parent6e4229e29c1ee3e0b7f3511f80b6108e3beb1efd (diff)
downloadgarage-6e69a1fffc715c752a399750c1e26aa46683dbb2.tar.gz
garage-6e69a1fffc715c752a399750c1e26aa46683dbb2.zip
[dep-upgrade-202402] prepare migration to http/hyper 1.0
Diffstat (limited to 'src/garage/tests/lib.rs')
-rw-r--r--src/garage/tests/lib.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/garage/tests/lib.rs b/src/garage/tests/lib.rs
index ab92bc0a..3cb17a2b 100644
--- a/src/garage/tests/lib.rs
+++ b/src/garage/tests/lib.rs
@@ -11,15 +11,10 @@ mod k2v;
#[cfg(feature = "k2v")]
mod k2v_client;
-use hyper::{Body, Response};
+use hyper::{body::HttpBody, Body, Response};
pub async fn json_body(res: Response<Body>) -> serde_json::Value {
- let res_body: serde_json::Value = serde_json::from_slice(
- &hyper::body::to_bytes(res.into_body())
- .await
- .unwrap()
- .to_vec()[..],
- )
- .unwrap();
+ let body = res.into_body().collect().await.unwrap().to_bytes();
+ let res_body: serde_json::Value = serde_json::from_slice(&body).unwrap();
res_body
}