From e5167e1aaec505271e9c91e45d47a95107990682 Mon Sep 17 00:00:00 2001 From: Magnus Hallin Date: Wed, 30 Nov 2016 20:50:08 +0100 Subject: [PATCH] Relax Iron handler context trait requirements --- src/integrations/iron_handlers.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/integrations/iron_handlers.rs b/src/integrations/iron_handlers.rs index f6c54778..91c12bc5 100644 --- a/src/integrations/iron_handlers.rs +++ b/src/integrations/iron_handlers.rs @@ -24,7 +24,7 @@ use ::{InputValue, GraphQLType, RootNode, execute}; /// mapping. pub struct GraphQLHandler where CtxFactory: Fn(&mut Request) -> CtxT + Send + Sync + 'static, - CtxT: Send + Sync + 'static, + CtxT: 'static, Query: GraphQLType + Send + Sync + 'static, Mutation: GraphQLType + Send + Sync + 'static, { @@ -40,14 +40,14 @@ pub struct GraphiQLHandler { impl GraphQLHandler where CtxFactory: Fn(&mut Request) -> CtxT + Send + Sync + 'static, - CtxT: Send + Sync + 'static, + CtxT: 'static, Query: GraphQLType + Send + Sync + 'static, Mutation: GraphQLType + Send + Sync + 'static, { /// Build a new GraphQL handler /// /// The context factory will receive the Iron request object and is - /// expected to construct a context object for the given schema. This can + /// expected to construct a context object for the given schema. This can /// be used to construct e.g. database connections or similar data that /// the schema needs to execute the query. pub fn new(context_factory: CtxFactory, query: Query, mutation: Mutation) -> Self { @@ -149,7 +149,7 @@ impl Handler for GraphQLHandler where CtxFactory: Fn(&mut Request) -> CtxT + Send + Sync + 'static, - CtxT: Send + Sync + 'static, + CtxT: 'static, Query: GraphQLType + Send + Sync + 'static, Mutation: GraphQLType + Send + Sync + 'static, { @@ -240,7 +240,7 @@ impl Handler for GraphiQLHandler { #[cfg(test)] mod tests { use rustc_serialize::json::Json; - + use iron::prelude::*; use iron::status; use iron::headers;