Skip to content

Commit ef2277c

Browse files
committed
Update delay to latest tokio usage
1 parent 560a172 commit ef2277c

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

juniper/src/executor_tests/async_await/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl User {
3636

3737
async fn delayed() -> bool {
3838
let when = tokio::clock::now() + std::time::Duration::from_millis(100);
39-
tokio::timer::Delay::new(when).await;
39+
tokio::timer::delay(when).await;
4040
true
4141
}
4242
}
@@ -63,7 +63,7 @@ impl Query {
6363

6464
async fn delayed() -> bool {
6565
let when = tokio::clock::now() + std::time::Duration::from_millis(100);
66-
tokio::timer::Delay::new(when).await;
66+
tokio::timer::delay(when).await;
6767
true
6868
}
6969
}

juniper/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,14 @@ extern crate uuid;
110110
// This allows users to just depend on juniper and get the derive
111111
// functionality automatically.
112112
pub use juniper_codegen::{
113-
object, GraphQLEnum, GraphQLInputObject, GraphQLObject, GraphQLScalarValue, ScalarValue,
114-
union,
113+
object, union, GraphQLEnum, GraphQLInputObject, GraphQLObject, GraphQLScalarValue, ScalarValue,
115114
};
116115
// Internal macros are not exported,
117116
// but declared at the root to make them easier to use.
118117
#[allow(unused_imports)]
119118
use juniper_codegen::{
120-
object_internal, GraphQLEnumInternal, GraphQLInputObjectInternal, GraphQLScalarValueInternal,
121-
union_internal,
119+
object_internal, union_internal, GraphQLEnumInternal, GraphQLInputObjectInternal,
120+
GraphQLScalarValueInternal,
122121
};
123122

124123
#[macro_use]

juniper/src/macros/tests/union.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Syntax to validate:
1010
*
1111
*/
1212

13-
1413
use std::marker::PhantomData;
1514

1615
use crate::{
@@ -50,16 +49,20 @@ impl Concrete {
5049
impl CustomName {
5150
fn resolve(&self) {
5251
match self {
53-
Concrete => match *self { CustomName::Concrete(ref c) => Some(c) },
52+
Concrete => match *self {
53+
CustomName::Concrete(ref c) => Some(c),
54+
},
5455
}
5556
}
5657
}
5758

5859
#[crate::union_internal]
59-
impl<'a> WithLifetime<'a>{
60+
impl<'a> WithLifetime<'a> {
6061
fn resolve(&self) {
6162
match self {
62-
Concrete => match *self { WithLifetime::Int(_) => Some(&Concrete) },
63+
Concrete => match *self {
64+
WithLifetime::Int(_) => Some(&Concrete),
65+
},
6366
}
6467
}
6568
}
@@ -68,7 +71,9 @@ impl<'a> WithLifetime<'a>{
6871
impl<T> WithGenerics<T> {
6972
fn resolve(&self) {
7073
match self {
71-
Concrete => match *self { WithGenerics::Generic(_) => Some(&Concrete) }
74+
Concrete => match *self {
75+
WithGenerics::Generic(_) => Some(&Concrete),
76+
},
7277
}
7378
}
7479
}
@@ -77,7 +82,9 @@ impl<T> WithGenerics<T> {
7782
impl DescriptionFirst {
7883
fn resolve(&self) {
7984
match self {
80-
Concrete => match *self { DescriptionFirst::Concrete(ref c) => Some(c) },
85+
Concrete => match *self {
86+
DescriptionFirst::Concrete(ref c) => Some(c),
87+
},
8188
}
8289
}
8390
}
@@ -211,4 +218,3 @@ fn introspect_description_first() {
211218
)));
212219
});
213220
}
214-

juniper/src/tests/introspection_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ fn test_introspection_possible_types() {
234234
assert_eq!(possible_types, vec!["Human", "Droid"].into_iter().collect());
235235
}
236236

237-
/*
237+
/*
238238
* FIXME: make this work again
239239
#[test]
240240
fn test_builtin_introspection_query() {

0 commit comments

Comments
 (0)