aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/lib.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-05 19:57:35 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-05 19:57:35 +0100
commit81ccd4586ebdf707dfd37d4802e0cf475e11e004 (patch)
tree66355871fc313bf4cdde0866b335b4408597745d /src/garage/tests/lib.rs
parenta22bd319202f05bce4ad13072238c7ba81d518fb (diff)
downloadgarage-81ccd4586ebdf707dfd37d4802e0cf475e11e004.tar.gz
garage-81ccd4586ebdf707dfd37d4802e0cf475e11e004.zip
[dep-upgrade-202402] upgrade to http/hyper 1.x for tests
Diffstat (limited to 'src/garage/tests/lib.rs')
-rw-r--r--src/garage/tests/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/garage/tests/lib.rs b/src/garage/tests/lib.rs
index 3cb17a2b..ef370db3 100644
--- a/src/garage/tests/lib.rs
+++ b/src/garage/tests/lib.rs
@@ -11,9 +11,14 @@ mod k2v;
#[cfg(feature = "k2v")]
mod k2v_client;
-use hyper::{body::HttpBody, Body, Response};
+use http_body_util::BodyExt;
+use hyper::{body::Body, Response};
-pub async fn json_body(res: Response<Body>) -> serde_json::Value {
+pub async fn json_body<B>(res: Response<B>) -> serde_json::Value
+where
+ B: Body,
+ <B as Body>::Error: std::fmt::Debug,
+{
let body = res.into_body().collect().await.unwrap().to_bytes();
let res_body: serde_json::Value = serde_json::from_slice(&body).unwrap();
res_body