diff --git a/juniper_hyper/examples/hyper_server.rs b/juniper_hyper/examples/hyper_server.rs index ece4d368..58836986 100644 --- a/juniper_hyper/examples/hyper_server.rs +++ b/juniper_hyper/examples/hyper_server.rs @@ -26,11 +26,11 @@ async fn main() { let root_node = root_node.clone(); let ctx = db.clone(); - async move { + async { Ok::<_, hyper::Error>(service_fn(move |req| { let root_node = root_node.clone(); let ctx = ctx.clone(); - async move { + async { match (req.method(), req.uri().path()) { (&Method::GET, "/") => juniper_hyper::graphiql("/graphql", None).await, (&Method::GET, "/graphql") | (&Method::POST, "/graphql") => {