mirror of
https://github.com/tokio-rs/axum.git
synced 2025-10-03 07:44:52 +00:00
Fix docs for chained method routing (#1355)
This commit is contained in:
parent
6fc31e1888
commit
c6be977612
@ -178,7 +178,7 @@ macro_rules! chained_service_fn {
|
|||||||
/// Ok::<_, Infallible>(Response::new(Body::empty()))
|
/// Ok::<_, Infallible>(Response::new(Body::empty()))
|
||||||
/// });
|
/// });
|
||||||
///
|
///
|
||||||
/// // Requests to `GET /` will go to `service` and `POST /` will go to
|
/// // Requests to `POST /` will go to `service` and `GET /` will go to
|
||||||
/// // `other_service`.
|
/// // `other_service`.
|
||||||
/// let app = Router::new().route("/", post_service(service).get_service(other_service));
|
/// let app = Router::new().route("/", post_service(service).get_service(other_service));
|
||||||
/// # async {
|
/// # async {
|
||||||
@ -242,7 +242,7 @@ macro_rules! chained_handler_fn {
|
|||||||
///
|
///
|
||||||
/// async fn other_handler() {}
|
/// async fn other_handler() {}
|
||||||
///
|
///
|
||||||
/// // Requests to `GET /` will go to `handler` and `POST /` will go to
|
/// // Requests to `POST /` will go to `handler` and `GET /` will go to
|
||||||
/// // `other_handler`.
|
/// // `other_handler`.
|
||||||
/// let app = Router::new().route("/", post(handler).get(other_handler));
|
/// let app = Router::new().route("/", post(handler).get(other_handler));
|
||||||
/// # async {
|
/// # async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user