diff --git a/axum/src/middleware/from_fn.rs b/axum/src/middleware/from_fn.rs index e4c44c74f5..3ed7a959d5 100644 --- a/axum/src/middleware/from_fn.rs +++ b/axum/src/middleware/from_fn.rs @@ -19,9 +19,10 @@ use tower_service::Service; /// `from_fn` requires the function given to /// /// 1. Be an `async fn`. -/// 2. Take one or more [extractors] as the first arguments. -/// 3. Take [`Next`](Next) as the final argument. -/// 4. Return something that implements [`IntoResponse`]. +/// 2. Take zero or more [`FromRequestParts`] extractors. +/// 3. Take exactly one [`FromRequest`] extractor as the second to last argument. +/// 4. Take [`Next`](Next) as the last argument. +/// 5. Return something that implements [`IntoResponse`]. /// /// Note that this function doesn't support extracting [`State`]. For that, use [`from_fn_with_state`]. ///