mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-19 00:00:14 +02:00
Introduce Response type alias as a shorthand for Response<BoxBody> (#590)
* Introduce `Response` type alias as a shorthand * Don't re-export `Response` at the crate root
This commit is contained in:
@@ -12,10 +12,9 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use axum::{
|
||||
body::BoxBody,
|
||||
extract::{Form, FromRequest, RequestParts},
|
||||
http::{Response, StatusCode},
|
||||
response::{Html, IntoResponse},
|
||||
http::StatusCode,
|
||||
response::{Html, IntoResponse, Response},
|
||||
routing::get,
|
||||
BoxError, Router,
|
||||
};
|
||||
@@ -84,7 +83,7 @@ pub enum ServerError {
|
||||
}
|
||||
|
||||
impl IntoResponse for ServerError {
|
||||
fn into_response(self) -> Response<BoxBody> {
|
||||
fn into_response(self) -> Response {
|
||||
match self {
|
||||
ServerError::ValidationError(_) => {
|
||||
let message = format!("Input validation error: [{}]", self).replace("\n", ", ");
|
||||
|
||||
Reference in New Issue
Block a user