1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

remove some static contraints

This commit is contained in:
Nikolay Kim
2019-04-04 10:59:34 -07:00
parent dc7c3d37a1
commit bc834f6a03
15 changed files with 84 additions and 84 deletions

View File

@ -70,10 +70,8 @@ impl Default for Compress {
impl<S, P, B> Transform<S> for Compress
where
P: 'static,
B: MessageBody,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
{
type Request = ServiceRequest<P>;
type Response = ServiceResponse<Encoder<B>>;
@ -97,10 +95,8 @@ pub struct CompressMiddleware<S> {
impl<S, P, B> Service for CompressMiddleware<S>
where
P: 'static,
B: MessageBody,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
{
type Request = ServiceRequest<P>;
type Response = ServiceResponse<Encoder<B>>;
@ -134,10 +130,8 @@ where
#[doc(hidden)]
pub struct CompressResponse<S, P, B>
where
P: 'static,
B: MessageBody,
S: Service,
S::Future: 'static,
B: MessageBody,
{
fut: S::Future,
encoding: ContentEncoding,
@ -146,10 +140,8 @@ where
impl<S, P, B> Future for CompressResponse<S, P, B>
where
P: 'static,
B: MessageBody,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
{
type Item = ServiceResponse<Encoder<B>>;
type Error = S::Error;

View File

@ -477,8 +477,9 @@ fn cors<'a>(
impl<S, P, B> IntoTransform<CorsFactory, S> for Cors
where
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>> + 'static,
P: 'static,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
B: 'static,
{
fn into_transform(self) -> CorsFactory {
@ -541,7 +542,6 @@ where
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
P: 'static,
B: 'static,
{
type Request = ServiceRequest<P>;
@ -683,7 +683,6 @@ where
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
P: 'static,
B: 'static,
{
type Request = ServiceRequest<P>;
@ -826,7 +825,6 @@ mod tests {
+ 'static,
S::Future: 'static,
S::Error: 'static,
P: 'static,
B: 'static,
{
block_on(

View File

@ -202,10 +202,11 @@ impl<T> IdentityService<T> {
impl<S, T, P, B> Transform<S> for IdentityService<T>
where
P: 'static,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>> + 'static,
S::Future: 'static,
S::Error: 'static,
T: IdentityPolicy,
P: 'static,
B: 'static,
{
type Request = ServiceRequest<P>;
@ -235,6 +236,7 @@ where
B: 'static,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>> + 'static,
S::Future: 'static,
S::Error: 'static,
T: IdentityPolicy,
{
type Request = ServiceRequest<P>;