Remove the static constraint of the receive_body and receive_batch_body functions. #544

This commit is contained in:
Sunli 2021-06-16 17:20:41 +08:00
parent 849fb58cec
commit 185e003fba
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ pub use websocket::{ClientMessage, Protocols as WebSocketProtocols, WebSocket, W
/// Receive a GraphQL request from a content type and body.
pub async fn receive_body(
content_type: Option<impl AsRef<str>>,
body: impl AsyncRead + Send + 'static,
body: impl AsyncRead + Send,
opts: MultipartOptions,
) -> Result<Request, ParseRequestError> {
receive_batch_body(content_type, body, opts)
@ -28,7 +28,7 @@ pub async fn receive_body(
/// Receive a GraphQL request from a content type and body.
pub async fn receive_batch_body(
content_type: Option<impl AsRef<str>>,
body: impl AsyncRead + Send + 'static,
body: impl AsyncRead + Send,
opts: MultipartOptions,
) -> Result<BatchRequest, ParseRequestError> {
let content_type = content_type.as_ref().map(AsRef::as_ref);

View File

@ -39,7 +39,7 @@ impl MultipartOptions {
}
pub(super) async fn receive_batch_multipart(
body: impl AsyncRead + Send + 'static,
body: impl AsyncRead + Send,
boundary: impl Into<String>,
opts: MultipartOptions,
) -> Result<BatchRequest, ParseRequestError> {