Skip to content

Commit e90996c

Browse files
committed
fix(docs): Repair stale doctests exposed by cargo test step
1 parent 983ce6d commit e90996c

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tokio = { version = "1.26.0", features = ["full"] }
5050

5151
### Implementing a Windmark Server
5252

53-
```rust
53+
```rust,no_run
5454
// src/main.rs
5555
5656
use windmark::response::Response;

src/router.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ impl Router {
470470
///
471471
/// ```rust
472472
/// windmark::router::Router::new().add_header(
473-
/// |context: windmark::context::RouteContext| {
473+
/// |context: &windmark::context::RouteContext| {
474474
/// format!("This is displayed at the top of {}!", context.url.path())
475475
/// },
476476
/// );
@@ -492,7 +492,7 @@ impl Router {
492492
///
493493
/// ```rust
494494
/// windmark::router::Router::new().add_footer(
495-
/// |context: windmark::context::RouteContext| {
495+
/// |context: &windmark::context::RouteContext| {
496496
/// format!("This is displayed at the bottom of {}!", context.url.path())
497497
/// },
498498
/// );
@@ -737,7 +737,7 @@ impl Router {
737737
/// use log::info;
738738
///
739739
/// windmark::router::Router::new().set_pre_route_callback(
740-
/// |context: windmark::context::HookContext| {
740+
/// |context: &windmark::context::HookContext| {
741741
/// info!(
742742
/// "accepted connection from {}",
743743
/// context.peer_address.unwrap().ip(),
@@ -762,7 +762,7 @@ impl Router {
762762
/// use log::info;
763763
///
764764
/// windmark::router::Router::new().set_post_route_callback(
765-
/// |context: windmark::context::HookContext,
765+
/// |context: &windmark::context::HookContext,
766766
/// _content: &mut windmark::response::Response| {
767767
/// info!(
768768
/// "closed connection from {}",
@@ -859,7 +859,7 @@ impl Router {
859859
/// info!("clicker has been attached!");
860860
/// }
861861
///
862-
/// async fn on_pre_route(&mut self, context: HookContext) {
862+
/// async fn on_pre_route(&mut self, context: &HookContext) {
863863
/// self.clicks += 1;
864864
///
865865
/// info!(
@@ -869,7 +869,7 @@ impl Router {
869869
/// );
870870
/// }
871871
///
872-
/// async fn on_post_route(&mut self, context: HookContext) {
872+
/// async fn on_post_route(&mut self, context: &HookContext) {
873873
/// info!(
874874
/// "clicker has been called post-route on {} with {} clicks!",
875875
/// context.url.path(),
@@ -921,7 +921,7 @@ impl Router {
921921
/// info!("clicker has been attached!");
922922
/// }
923923
///
924-
/// fn on_pre_route(&mut self, context: HookContext) {
924+
/// fn on_pre_route(&mut self, context: &HookContext) {
925925
/// self.clicks += 1;
926926
///
927927
/// info!(
@@ -931,7 +931,7 @@ impl Router {
931931
/// );
932932
/// }
933933
///
934-
/// fn on_post_route(&mut self, context: HookContext) {
934+
/// fn on_post_route(&mut self, context: &HookContext) {
935935
/// info!(
936936
/// "clicker has been called post-route on {} with {} clicks!",
937937
/// context.url.path(),

0 commit comments

Comments
 (0)