From c69f40fc8f4bfe2c6b0bac64966d647fb313a02c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 27 Mar 2022 11:13:24 +0000 Subject: feat(pre/post_route_callback): fnmut closure --- examples/windmark.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') 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> { .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("/", |_| { -- cgit v1.2.3