Extend from_fn_with_state doctest (#1393)

This commit is contained in:
Jonas Platte
2022-09-19 21:02:43 +02:00
committed by GitHub
parent 4ade706ab0
commit 7105805ba2
+5 -2
View File
@@ -117,11 +117,14 @@ pub fn from_fn<F, T>(f: F) -> FromFnLayer<F, (), T> {
///
/// async fn my_middleware<B>(
/// State(state): State<AppState>,
/// // you can add more extractors here...
/// req: Request<B>,
/// next: Next<B>,
/// ) -> Response {
/// // ...
/// # ().into_response()
/// // do something with `req`...
/// let res = next.run(req).await;
/// // do something with `res`...
/// res
/// }
///
/// let state = AppState { /* ... */ };