Skip to content

Commit 92b69e5

Browse files
committed
Fix
1 parent 2f8555c commit 92b69e5

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

juniper_hyper/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ where
116116
.await
117117
.map_err(GraphQLRequestError::BodyHyper)?;
118118

119-
let input = String::from_utf8(chunk.to_bytes().iter().cloned().collect())
120-
.map_err(GraphQLRequestError::BodyUtf8)?;
119+
let input =
120+
String::from_utf8(chunk.to_bytes().into()).map_err(GraphQLRequestError::BodyUtf8)?;
121121

122122
serde_json::from_str::<GraphQLBatchRequest<S>>(&input)
123123
.map_err(GraphQLRequestError::BodyJSONError)
@@ -135,8 +135,8 @@ where
135135
.await
136136
.map_err(GraphQLRequestError::BodyHyper)?;
137137

138-
let query = String::from_utf8(chunk.to_bytes().iter().cloned().collect())
139-
.map_err(GraphQLRequestError::BodyUtf8)?;
138+
let query =
139+
String::from_utf8(chunk.to_bytes().into()).map_err(GraphQLRequestError::BodyUtf8)?;
140140

141141
Ok(GraphQLBatchRequest::Single(GraphQLRequest::new(
142142
query, None, None,

juniper_warp/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ http-body-util = "0.1.2"
4747
[dev-dependencies]
4848
async-stream = "0.3"
4949
env_logger = "0.11"
50-
futures = "0.3.22"
5150
http-body-util = "0.1.2"
5251
itertools = "0.14"
5352
juniper = { version = "0.16", path = "../juniper", features = ["expose-test-schema"] }

juniper_warp/tests/http_test_suite.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
#![expect(unused_crate_dependencies, reason = "integration tests")]
44

5-
use futures::TryStreamExt as _;
65
use http_body_util::BodyExt as _;
76
use itertools::Itertools as _;
87
use juniper::{
@@ -123,14 +122,8 @@ async fn into_test_response(resp: reply::Response) -> TestResponse {
123122
})
124123
.unwrap_or_default();
125124

126-
let body = String::from_utf8(
127-
body.into_data_stream()
128-
.map_ok(|bytes| bytes.to_vec())
129-
.try_concat()
130-
.await
131-
.unwrap(),
132-
)
133-
.unwrap_or_else(|e| panic!("not UTF-8 body: {e}"));
125+
let body = String::from_utf8(body.collect().await.unwrap().to_bytes().into())
126+
.unwrap_or_else(|e| panic!("not UTF-8 body: {e}"));
134127

135128
TestResponse {
136129
status_code,

0 commit comments

Comments
 (0)