Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compression: Remove ResBody::Error: Into<BoxError> bounds #117

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tower-http/src/compression/future.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(unused_imports)]

use super::{body::BodyInner, CompressionBody, Encoding};
use crate::compression_utils::{supports_transparent_compression, BoxError, WrapBody};
use crate::compression_utils::{supports_transparent_compression, WrapBody};
use futures_util::ready;
use http::{header, HeaderMap, HeaderValue, Response};
use http_body::Body;
Expand Down
3 changes: 1 addition & 2 deletions tower-http/src/compression/service.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{CompressionBody, CompressionLayer, Encoding, ResponseFuture};
use crate::compression_utils::{AcceptEncoding, BoxError};
use crate::compression_utils::AcceptEncoding;
use http::{Request, Response};
use http_body::Body;
use std::task::{Context, Poll};
Expand Down Expand Up @@ -88,7 +88,6 @@ impl<ReqBody, ResBody, S> Service<Request<ReqBody>> for Compression<S>
where
S: Service<Request<ReqBody>, Response = Response<ResBody>>,
ResBody: Body,
ResBody::Error: Into<BoxError>,
{
type Response = Response<CompressionBody<ResBody>>;
type Error = S::Error;
Expand Down
2 changes: 0 additions & 2 deletions tower-http/src/compression_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ use tokio_util::io::{poll_read_buf, StreamReader};

use crate::BodyOrIoError;

pub(crate) type BoxError = Box<dyn std::error::Error + Send + Sync>;

#[derive(Debug, Clone, Copy)]
pub(crate) struct AcceptEncoding {
pub(crate) gzip: bool,
Expand Down
3 changes: 1 addition & 2 deletions tower-http/src/decompression/future.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(unused_imports)]

use super::{body::BodyInner, DecompressionBody};
use crate::compression_utils::{AcceptEncoding, BoxError, WrapBody};
use crate::compression_utils::{AcceptEncoding, WrapBody};
use futures_util::ready;
use http::{header, Response};
use http_body::Body;
Expand All @@ -27,7 +27,6 @@ impl<F, B, E> Future for ResponseFuture<F>
where
F: Future<Output = Result<Response<B>, E>>,
B: Body,
B::Error: Into<BoxError>,
{
type Output = Result<Response<DecompressionBody<B>>, E>;

Expand Down
3 changes: 1 addition & 2 deletions tower-http/src/decompression/service.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{DecompressionBody, DecompressionLayer, ResponseFuture};
use crate::compression_utils::{supports_transparent_compression, AcceptEncoding, BoxError};
use crate::compression_utils::{supports_transparent_compression, AcceptEncoding};
use http::{
header::{self, ACCEPT_ENCODING, RANGE},
Request, Response,
Expand Down Expand Up @@ -91,7 +91,6 @@ impl<S, ReqBody, ResBody> Service<Request<ReqBody>> for Decompression<S>
where
S: Service<Request<ReqBody>, Response = Response<ResBody>>,
ResBody: Body,
ResBody::Error: Into<BoxError>,
{
type Response = Response<DecompressionBody<ResBody>>;
type Error = S::Error;
Expand Down