Replace futures::future::FutureExt::boxed with Box::pin

This commit is contained in:
Christian Legnitto 2019-08-26 21:37:38 -07:00
parent c270c038ef
commit 045c1870ef
4 changed files with 15 additions and 15 deletions

View file

@ -432,7 +432,7 @@ macro_rules! graphql_scalar {
use $crate::GraphQLType; use $crate::GraphQLType;
use futures::future; use futures::future;
let v = self.resolve(info, selection_set, executor); let v = self.resolve(info, selection_set, executor);
future::FutureExt::boxed(future::ready(v)) Box::pin(future::ready(v))
} }
} }
); );

View file

@ -99,7 +99,7 @@ where
match field_name { match field_name {
"__schema" | "__type" => { "__schema" | "__type" => {
let v = self.resolve_field(info, field_name, arguments, executor); let v = self.resolve_field(info, field_name, arguments, executor);
ready(v).boxed() Box::pin(ready(v))
} }
_ => self _ => self
.query_type .query_type

View file

@ -60,9 +60,12 @@ where
'e: 'a, 'e: 'a,
for<'b> &'b S: ScalarRefValue<'b>, for<'b> &'b S: ScalarRefValue<'b>,
{ {
use futures::future::FutureExt; Box::pin(resolve_selection_set_into_async_recursive(
instance,
resolve_selection_set_into_async_recursive(instance, info, selection_set, executor).boxed() info,
selection_set,
executor,
))
} }
struct AsyncField<S> { struct AsyncField<S> {
@ -89,10 +92,7 @@ where
CtxT: Send + Sync, CtxT: Send + Sync,
for<'b> &'b S: ScalarRefValue<'b>, for<'b> &'b S: ScalarRefValue<'b>,
{ {
use futures::{ use futures::stream::{FuturesOrdered, StreamExt};
future::FutureExt,
stream::{FuturesOrdered, StreamExt},
};
let mut object = Object::with_capacity(selection_set.len()); let mut object = Object::with_capacity(selection_set.len());
@ -183,7 +183,7 @@ where
value, value,
}) })
}; };
async_values.push(field_future.boxed()); async_values.push(Box::pin(field_future));
} }
Selection::FragmentSpread(Spanning { Selection::FragmentSpread(Spanning {
item: ref spread, .. item: ref spread, ..
@ -206,7 +206,7 @@ where
.await; .await;
AsyncValue::Nested(value) AsyncValue::Nested(value)
}; };
async_values.push(f.boxed()); async_values.push(Box::pin(f));
} }
Selection::InlineFragment(Spanning { Selection::InlineFragment(Spanning {
item: ref fragment, item: ref fragment,
@ -250,7 +250,7 @@ where
.await; .await;
AsyncValue::Nested(value) AsyncValue::Nested(value)
}; };
async_values.push(f.boxed()); async_values.push(Box::pin(f));
} }
} }
} }

View file

@ -272,7 +272,7 @@ where
executor: &'a Executor<Self::Context, S>, executor: &'a Executor<Self::Context, S>,
) -> crate::BoxFuture<'a, Value<S>> { ) -> crate::BoxFuture<'a, Value<S>> {
let f = resolve_into_list_async(executor, info, self.iter()); 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>, executor: &'a Executor<Self::Context, S>,
) -> crate::BoxFuture<'a, Value<S>> { ) -> crate::BoxFuture<'a, Value<S>> {
let f = resolve_into_list_async(executor, info, self.iter()); 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(), None => Value::null(),
} }
}; };
futures::future::FutureExt::boxed(f) Box::pin(f)
} }
} }