diff --git a/axum/src/middleware/from_fn.rs b/axum/src/middleware/from_fn.rs index ac22bec1..7fb93474 100644 --- a/axum/src/middleware/from_fn.rs +++ b/axum/src/middleware/from_fn.rs @@ -117,11 +117,14 @@ pub fn from_fn(f: F) -> FromFnLayer { /// /// async fn my_middleware( /// State(state): State, +/// // you can add more extractors here... /// req: Request, /// next: Next, /// ) -> Response { -/// // ... -/// # ().into_response() +/// // do something with `req`... +/// let res = next.run(req).await; +/// // do something with `res`... +/// res /// } /// /// let state = AppState { /* ... */ };