Skip to content

Commit e5167e1

Browse files
committed
Relax Iron handler context trait requirements
1 parent f7123ed commit e5167e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/integrations/iron_handlers.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use ::{InputValue, GraphQLType, RootNode, execute};
2424
/// mapping.
2525
pub struct GraphQLHandler<CtxFactory, Query, Mutation, CtxT>
2626
where CtxFactory: Fn(&mut Request) -> CtxT + Send + Sync + 'static,
27-
CtxT: Send + Sync + 'static,
27+
CtxT: 'static,
2828
Query: GraphQLType<CtxT> + Send + Sync + 'static,
2929
Mutation: GraphQLType<CtxT> + Send + Sync + 'static,
3030
{
@@ -40,14 +40,14 @@ pub struct GraphiQLHandler {
4040
impl<CtxFactory, Query, Mutation, CtxT>
4141
GraphQLHandler<CtxFactory, Query, Mutation, CtxT>
4242
where CtxFactory: Fn(&mut Request) -> CtxT + Send + Sync + 'static,
43-
CtxT: Send + Sync + 'static,
43+
CtxT: 'static,
4444
Query: GraphQLType<CtxT> + Send + Sync + 'static,
4545
Mutation: GraphQLType<CtxT> + Send + Sync + 'static,
4646
{
4747
/// Build a new GraphQL handler
4848
///
4949
/// The context factory will receive the Iron request object and is
50-
/// expected to construct a context object for the given schema. This can
50+
/// expected to construct a context object for the given schema. This can
5151
/// be used to construct e.g. database connections or similar data that
5252
/// the schema needs to execute the query.
5353
pub fn new(context_factory: CtxFactory, query: Query, mutation: Mutation) -> Self {
@@ -149,7 +149,7 @@ impl<CtxFactory, Query, Mutation, CtxT>
149149
Handler
150150
for GraphQLHandler<CtxFactory, Query, Mutation, CtxT>
151151
where CtxFactory: Fn(&mut Request) -> CtxT + Send + Sync + 'static,
152-
CtxT: Send + Sync + 'static,
152+
CtxT: 'static,
153153
Query: GraphQLType<CtxT> + Send + Sync + 'static,
154154
Mutation: GraphQLType<CtxT> + Send + Sync + 'static,
155155
{
@@ -240,7 +240,7 @@ impl Handler for GraphiQLHandler {
240240
#[cfg(test)]
241241
mod tests {
242242
use rustc_serialize::json::Json;
243-
243+
244244
use iron::prelude::*;
245245
use iron::status;
246246
use iron::headers;

0 commit comments

Comments
 (0)