From 8fd1608381faee0a59bf14aac2bd5d5bbb8a8d7a Mon Sep 17 00:00:00 2001 From: XiNiHa Date: Wed, 16 Jun 2021 16:36:45 +0900 Subject: [PATCH] Update rocket to 0.5.0-rc.1 --- integrations/rocket/Cargo.toml | 2 +- integrations/rocket/src/lib.rs | 10 ++-------- src/http/mod.rs | 2 +- src/http/multipart.rs | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/integrations/rocket/Cargo.toml b/integrations/rocket/Cargo.toml index aac418f3..a627f427 100644 --- a/integrations/rocket/Cargo.toml +++ b/integrations/rocket/Cargo.toml @@ -16,7 +16,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-graphql = { path = "../..", version = "=2.9.2" } -rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "fa3e033", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released +rocket = { version = "0.5.0-rc.1", default-features = false } serde = "1.0.126" serde_json = "1.0.64" tokio-util = { version = "0.6.7", default-features = false, features = ["compat"] } diff --git a/integrations/rocket/src/lib.rs b/integrations/rocket/src/lib.rs index c6bf3ad1..f9f58e5b 100644 --- a/integrations/rocket/src/lib.rs +++ b/integrations/rocket/src/lib.rs @@ -56,10 +56,7 @@ impl BatchRequest { impl<'r> FromData<'r> for BatchRequest { type Error = ParseRequestError; - async fn from_data( - req: &'r rocket::Request<'_>, - data: Data, - ) -> data::Outcome { + async fn from_data(req: &'r rocket::Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> { let opts: MultipartOptions = req.rocket().state().copied().unwrap_or_default(); let request = async_graphql::http::receive_batch_body( @@ -177,10 +174,7 @@ impl Query { impl<'r> FromData<'r> for Request { type Error = ParseRequestError; - async fn from_data( - req: &'r rocket::Request<'_>, - data: Data, - ) -> data::Outcome { + async fn from_data(req: &'r rocket::Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> { BatchRequest::from_data(req, data) .await .and_then(|request| match request.0.into_single() { diff --git a/src/http/mod.rs b/src/http/mod.rs index ce1fc9bf..bd0733d2 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -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>, - body: impl AsyncRead + Send + 'static, + body: impl AsyncRead + Send, opts: MultipartOptions, ) -> Result { let content_type = content_type.as_ref().map(AsRef::as_ref); diff --git a/src/http/multipart.rs b/src/http/multipart.rs index ded7d8de..020a542e 100644 --- a/src/http/multipart.rs +++ b/src/http/multipart.rs @@ -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, opts: MultipartOptions, ) -> Result {