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 futures::future;
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 {
"__schema" | "__type" => {
let v = self.resolve_field(info, field_name, arguments, executor);
ready(v).boxed()
Box::pin(ready(v))
}
_ => self
.query_type

View file

@ -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));
}
}
}

View file

@ -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)
}
}