diff --git a/axum-core/src/response/mod.rs b/axum-core/src/response/mod.rs index 94e4b0fc6b5..d821755a255 100644 --- a/axum-core/src/response/mod.rs +++ b/axum-core/src/response/mod.rs @@ -36,9 +36,17 @@ pub type Response = http::Response; /// http::StatusCode, /// }; /// +/// fn foo() -> Result<(), (StatusCode, &'static str)> { +/// Err((StatusCode::NOT_FOUND, "not found")) +/// } +/// +/// fn bar() -> Result<(), StatusCode> { +/// Err(StatusCode::BAD_REQUEST) +/// } +/// /// fn handler() -> Result<&'static str> { -/// Err((StatusCode::NOT_FOUND, "not found"))?; -/// Err(StatusCode::BAD_REQUEST)?; +/// foo()?; +/// bar()?; /// Ok("ok") /// } /// ```