diff --git a/juniper/src/macros/scalar.rs b/juniper/src/macros/scalar.rs index 50753f3b..4f3ae84e 100644 --- a/juniper/src/macros/scalar.rs +++ b/juniper/src/macros/scalar.rs @@ -432,7 +432,7 @@ macro_rules! graphql_scalar { use $crate::GraphQLType; use futures::future; let v = self.resolve(info, selection_set, executor); - future::FutureExt::boxed(future::ready(v)) + Box::pin(future::ready(v)) } } ); diff --git a/juniper/src/schema/schema.rs b/juniper/src/schema/schema.rs index f71e9b18..14c3f2c2 100644 --- a/juniper/src/schema/schema.rs +++ b/juniper/src/schema/schema.rs @@ -99,7 +99,7 @@ where match field_name { "__schema" | "__type" => { let v = self.resolve_field(info, field_name, arguments, executor); - ready(v).boxed() + Box::pin(ready(v)) } _ => self .query_type diff --git a/juniper/src/types/async_await.rs b/juniper/src/types/async_await.rs index ec11172f..ab7b95d4 100644 --- a/juniper/src/types/async_await.rs +++ b/juniper/src/types/async_await.rs @@ -60,9 +60,12 @@ where 'e: 'a, for<'b> &'b S: ScalarRefValue<'b>, { - use futures::future::FutureExt; - - resolve_selection_set_into_async_recursive(instance, info, selection_set, executor).boxed() + Box::pin(resolve_selection_set_into_async_recursive( + instance, + info, + selection_set, + executor, + )) } struct AsyncField<S> { @@ -89,10 +92,7 @@ where CtxT: Send + Sync, for<'b> &'b S: ScalarRefValue<'b>, { - use futures::{ - future::FutureExt, - stream::{FuturesOrdered, StreamExt}, - }; + use futures::stream::{FuturesOrdered, StreamExt}; let mut object = Object::with_capacity(selection_set.len()); @@ -183,7 +183,7 @@ where value, }) }; - async_values.push(field_future.boxed()); + async_values.push(Box::pin(field_future)); } Selection::FragmentSpread(Spanning { item: ref spread, .. @@ -206,7 +206,7 @@ where .await; AsyncValue::Nested(value) }; - async_values.push(f.boxed()); + async_values.push(Box::pin(f)); } Selection::InlineFragment(Spanning { item: ref fragment, @@ -250,7 +250,7 @@ where .await; AsyncValue::Nested(value) }; - async_values.push(f.boxed()); + async_values.push(Box::pin(f)); } } } diff --git a/juniper/src/types/containers.rs b/juniper/src/types/containers.rs index 8004dbaf..06634072 100644 --- a/juniper/src/types/containers.rs +++ b/juniper/src/types/containers.rs @@ -272,7 +272,7 @@ where executor: &'a Executor<Self::Context, S>, ) -> crate::BoxFuture<'a, Value<S>> { let f = resolve_into_list_async(executor, info, self.iter()); - futures::future::FutureExt::boxed(f) + Box::pin(f) } } @@ -292,7 +292,7 @@ where executor: &'a Executor<Self::Context, S>, ) -> crate::BoxFuture<'a, Value<S>> { let f = resolve_into_list_async(executor, info, self.iter()); - futures::future::FutureExt::boxed(f) + Box::pin(f) } } @@ -317,6 +317,6 @@ where None => Value::null(), } }; - futures::future::FutureExt::boxed(f) + Box::pin(f) } }