mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Remove tower from axum's public API (#229)
Instead rely on `tower-service` and `tower-layer`. `tower` itself is only used internally. Fixes https://github.com/tokio-rs/axum/issues/186
This commit is contained in:
+1
-18
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::{
|
||||
body::{box_body, BoxBody},
|
||||
Error,
|
||||
BoxError, Error,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use http::{header, HeaderMap, HeaderValue, Response, StatusCode};
|
||||
@@ -11,7 +11,6 @@ use http_body::{
|
||||
Empty, Full,
|
||||
};
|
||||
use std::{borrow::Cow, convert::Infallible};
|
||||
use tower::{util::Either, BoxError};
|
||||
|
||||
mod headers;
|
||||
mod redirect;
|
||||
@@ -154,22 +153,6 @@ impl IntoResponse for Infallible {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, K> IntoResponse for Either<T, K>
|
||||
where
|
||||
T: IntoResponse,
|
||||
K: IntoResponse,
|
||||
{
|
||||
type Body = BoxBody;
|
||||
type BodyError = Error;
|
||||
|
||||
fn into_response(self) -> Response<Self::Body> {
|
||||
match self {
|
||||
Either::A(inner) => inner.into_response().map(box_body),
|
||||
Either::B(inner) => inner.into_response().map(box_body),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E> IntoResponse for Result<T, E>
|
||||
where
|
||||
T: IntoResponse,
|
||||
|
||||
Reference in New Issue
Block a user