From e90996c8426ceb720c56b74bf4bfb8b3bcc2cd36 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 27 Apr 2026 06:03:39 +0000 Subject: fix(docs): Repair stale doctests exposed by cargo test step --- README.md | 2 +- src/router.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 698e09c..3b9b879 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ tokio = { version = "1.26.0", features = ["full"] } ### Implementing a Windmark Server -```rust +```rust,no_run // src/main.rs use windmark::response::Response; diff --git a/src/router.rs b/src/router.rs index b6a960d..f1c05e5 100644 --- a/src/router.rs +++ b/src/router.rs @@ -470,7 +470,7 @@ impl Router { /// /// ```rust /// windmark::router::Router::new().add_header( - /// |context: windmark::context::RouteContext| { + /// |context: &windmark::context::RouteContext| { /// format!("This is displayed at the top of {}!", context.url.path()) /// }, /// ); @@ -492,7 +492,7 @@ impl Router { /// /// ```rust /// windmark::router::Router::new().add_footer( - /// |context: windmark::context::RouteContext| { + /// |context: &windmark::context::RouteContext| { /// format!("This is displayed at the bottom of {}!", context.url.path()) /// }, /// ); @@ -737,7 +737,7 @@ impl Router { /// use log::info; /// /// windmark::router::Router::new().set_pre_route_callback( - /// |context: windmark::context::HookContext| { + /// |context: &windmark::context::HookContext| { /// info!( /// "accepted connection from {}", /// context.peer_address.unwrap().ip(), @@ -762,7 +762,7 @@ impl Router { /// use log::info; /// /// windmark::router::Router::new().set_post_route_callback( - /// |context: windmark::context::HookContext, + /// |context: &windmark::context::HookContext, /// _content: &mut windmark::response::Response| { /// info!( /// "closed connection from {}", @@ -859,7 +859,7 @@ impl Router { /// info!("clicker has been attached!"); /// } /// - /// async fn on_pre_route(&mut self, context: HookContext) { + /// async fn on_pre_route(&mut self, context: &HookContext) { /// self.clicks += 1; /// /// info!( @@ -869,7 +869,7 @@ impl Router { /// ); /// } /// - /// async fn on_post_route(&mut self, context: HookContext) { + /// async fn on_post_route(&mut self, context: &HookContext) { /// info!( /// "clicker has been called post-route on {} with {} clicks!", /// context.url.path(), @@ -921,7 +921,7 @@ impl Router { /// info!("clicker has been attached!"); /// } /// - /// fn on_pre_route(&mut self, context: HookContext) { + /// fn on_pre_route(&mut self, context: &HookContext) { /// self.clicks += 1; /// /// info!( @@ -931,7 +931,7 @@ impl Router { /// ); /// } /// - /// fn on_post_route(&mut self, context: HookContext) { + /// fn on_post_route(&mut self, context: &HookContext) { /// info!( /// "clicker has been called post-route on {} with {} clicks!", /// context.url.path(), -- cgit v1.2.3