diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/windmark.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/windmark.rs b/examples/windmark.rs index a5bfc9a..21c84a8 100644 --- a/examples/windmark.rs +++ b/examples/windmark.rs @@ -41,19 +41,19 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { .attach(|r| { r.mount("/module", |_| Response::Success("This is a module!".into())); }) - .set_pre_route_callback(|stream, url, _| { + .set_pre_route_callback(Box::new(|stream, url, _| { info!( "accepted connection from {} to {}", stream.peer_addr().unwrap().ip(), url.to_string() ) - }) - .set_post_route_callback(|stream, _url, _| { + })) + .set_post_route_callback(Box::new(|stream, _url, _| { info!( "closed connection from {}", stream.peer_addr().unwrap().ip() ) - }) + })) .set_header(|_| "```\nART IS COOL\n```".to_string()) .set_footer(|_| "Copyright 2022".to_string()) .mount("/", |_| { |