Use impl IntoResponse less in docs (#1049)

This commit is contained in:
David Pedersen
2022-05-22 13:41:29 +02:00
committed by GitHub
parent 1d7878c3c8
commit 19fe93262f
17 changed files with 88 additions and 47 deletions
@@ -57,7 +57,10 @@ use std::{
/// }
///
/// // We can now return `SetHeader` in responses
/// async fn handler() -> impl IntoResponse {
/// //
/// // Note that returning `impl IntoResponse` might be easier if the response has many parts to
/// // it. The return type is written out here for clarity.
/// async fn handler() -> (SetHeader<'static>, SetHeader<'static>, &'static str) {
/// (
/// SetHeader("server", "axum"),
/// SetHeader("x-foo", "custom"),
@@ -66,7 +69,7 @@ use std::{
/// }
///
/// // Or on its own as the whole response
/// async fn other_handler() -> impl IntoResponse {
/// async fn other_handler() -> SetHeader<'static> {
/// SetHeader("x-foo", "custom")
/// }
/// ```