Update delay to latest tokio usage
This commit is contained in:
parent
560a172587
commit
ef2277c80f
4 changed files with 19 additions and 14 deletions
|
@ -36,7 +36,7 @@ impl User {
|
|||
|
||||
async fn delayed() -> bool {
|
||||
let when = tokio::clock::now() + std::time::Duration::from_millis(100);
|
||||
tokio::timer::Delay::new(when).await;
|
||||
tokio::timer::delay(when).await;
|
||||
true
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ impl Query {
|
|||
|
||||
async fn delayed() -> bool {
|
||||
let when = tokio::clock::now() + std::time::Duration::from_millis(100);
|
||||
tokio::timer::Delay::new(when).await;
|
||||
tokio::timer::delay(when).await;
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,15 +110,14 @@ extern crate uuid;
|
|||
// This allows users to just depend on juniper and get the derive
|
||||
// functionality automatically.
|
||||
pub use juniper_codegen::{
|
||||
object, GraphQLEnum, GraphQLInputObject, GraphQLObject, GraphQLScalarValue, ScalarValue,
|
||||
union,
|
||||
object, union, GraphQLEnum, GraphQLInputObject, GraphQLObject, GraphQLScalarValue, ScalarValue,
|
||||
};
|
||||
// Internal macros are not exported,
|
||||
// but declared at the root to make them easier to use.
|
||||
#[allow(unused_imports)]
|
||||
use juniper_codegen::{
|
||||
object_internal, GraphQLEnumInternal, GraphQLInputObjectInternal, GraphQLScalarValueInternal,
|
||||
union_internal,
|
||||
object_internal, union_internal, GraphQLEnumInternal, GraphQLInputObjectInternal,
|
||||
GraphQLScalarValueInternal,
|
||||
};
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -10,7 +10,6 @@ Syntax to validate:
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{
|
||||
|
@ -50,16 +49,20 @@ impl Concrete {
|
|||
impl CustomName {
|
||||
fn resolve(&self) {
|
||||
match self {
|
||||
Concrete => match *self { CustomName::Concrete(ref c) => Some(c) },
|
||||
Concrete => match *self {
|
||||
CustomName::Concrete(ref c) => Some(c),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[crate::union_internal]
|
||||
impl<'a> WithLifetime<'a>{
|
||||
impl<'a> WithLifetime<'a> {
|
||||
fn resolve(&self) {
|
||||
match self {
|
||||
Concrete => match *self { WithLifetime::Int(_) => Some(&Concrete) },
|
||||
Concrete => match *self {
|
||||
WithLifetime::Int(_) => Some(&Concrete),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +71,9 @@ impl<'a> WithLifetime<'a>{
|
|||
impl<T> WithGenerics<T> {
|
||||
fn resolve(&self) {
|
||||
match self {
|
||||
Concrete => match *self { WithGenerics::Generic(_) => Some(&Concrete) }
|
||||
Concrete => match *self {
|
||||
WithGenerics::Generic(_) => Some(&Concrete),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +82,9 @@ impl<T> WithGenerics<T> {
|
|||
impl DescriptionFirst {
|
||||
fn resolve(&self) {
|
||||
match self {
|
||||
Concrete => match *self { DescriptionFirst::Concrete(ref c) => Some(c) },
|
||||
Concrete => match *self {
|
||||
DescriptionFirst::Concrete(ref c) => Some(c),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -211,4 +218,3 @@ fn introspect_description_first() {
|
|||
)));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ fn test_introspection_possible_types() {
|
|||
assert_eq!(possible_types, vec!["Human", "Droid"].into_iter().collect());
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* FIXME: make this work again
|
||||
#[test]
|
||||
fn test_builtin_introspection_query() {
|
||||
|
|
Loading…
Reference in a new issue