diff --git a/examples/disk-auth.rs b/examples/disk-auth.rs index 0b31ed7..c3af048 100644 --- a/examples/disk-auth.rs +++ b/examples/disk-auth.rs @@ -5,14 +5,11 @@ use ratpack::{app::App, compose_handler, handler::Params, Error, HTTPResult, Ser const DEFAULT_AUTHTOKEN: &str = "867-5309"; const AUTHTOKEN_FILENAME: &str = "authtoken.secret"; -#[derive(Clone)] -struct State; - async fn validate_authtoken( req: Request, resp: Option>, _params: Params, - _app: App, + _app: App<()>, ) -> HTTPResult { let token = req.headers().get("X-AuthToken"); if token.is_none() { @@ -40,7 +37,7 @@ async fn hello( req: Request, _resp: Option>, params: Params, - _app: App, + _app: App<()>, ) -> HTTPResult { let name = params.get("name").unwrap(); let bytes = Body::from(format!("hello, {}!\n", name)); diff --git a/examples/hello-world.rs b/examples/hello-world.rs index ddf704d..21202ec 100644 --- a/examples/hello-world.rs +++ b/examples/hello-world.rs @@ -2,14 +2,11 @@ use http::{Request, Response}; use hyper::Body; use ratpack::{app::App, compose_handler, handler::Params, HTTPResult, ServerError}; -#[derive(Clone)] -struct State; - async fn hello( req: Request, _resp: Option>, params: Params, - _app: App, + _app: App<()>, ) -> HTTPResult { let name = params.get("name").unwrap(); let bytes = Body::from(format!("hello, {}!\n", name)); diff --git a/examples/log.rs b/examples/log.rs index 77a770b..b1157a0 100644 --- a/examples/log.rs +++ b/examples/log.rs @@ -3,14 +3,11 @@ use hyper::Body; use log::LevelFilter; use ratpack::{app::App, compose_handler, handler::Params, HTTPResult, ServerError}; -#[derive(Clone)] -struct State; - async fn log( req: Request, resp: Option>, _params: Params, - _app: App, + _app: App<()>, ) -> HTTPResult { log::trace!("New request: {}", req.uri().path()); Ok((req, resp)) @@ -20,7 +17,7 @@ async fn hello( req: Request, _resp: Option>, params: Params, - _app: App, + _app: App<()>, ) -> HTTPResult { let name = params.get("name").unwrap(); log::info!("Saying hello to {}", name);